Java Android Json解析出现错误

Java Android Json解析出现错误,java,android,json,Java,Android,Json,在我的Android应用程序中,我使用json连接服务器以显示值。。数据保存在服务器内部。当值是1,2,3之类的整数时,我将得到结果。。我也能得到结果。。。但是当我试图得到像A,B,C这样的char值时,我没有得到结果。。。我正在给你密码。。请检查,如果有任何错误,请帮助 阶级 CustomHttpClient.java import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamRea

在我的Android应用程序中,我使用json连接服务器以显示值。。数据保存在服务器内部。当值是1,2,3之类的整数时,我将得到结果。。我也能得到结果。。。但是当我试图得到像A,B,C这样的char值时,我没有得到结果。。。我正在给你密码。。请检查,如果有任何错误,请帮助

阶级


CustomHttpClient.java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.ArrayList;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;

public class CustomHttpClient {
/** The time it takes for our client to timeout */
public static final int HTTP_TIMEOUT = 30 * 1000; // milliseconds

/** Single instance of our HttpClient */
private static HttpClient mHttpClient;

/**
 * Get our single instance of our HttpClient object.
 *
 * @return an HttpClient object with connection parameters set
 */
private static HttpClient getHttpClient() {
    if (mHttpClient == null) {
        mHttpClient = new DefaultHttpClient();
        final HttpParams params = mHttpClient.getParams();
        HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT);
        HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT);
        ConnManagerParams.setTimeout(params, HTTP_TIMEOUT);
    }
    return mHttpClient;
}

/**
 * Performs an HTTP Post request to the specified url with the
 * specified parameters.
 *
 * @param url The web address to post the request to
 * @param postParameters The parameters to send via the request
 * @return The result of the request
 * @throws Exception
 */
public static String executeHttpPost(String url, ArrayList<NameValuePair> postParameters) throws Exception {
    BufferedReader in = null;
    try {
        HttpClient client = getHttpClient();
        HttpPost request = new HttpPost(url);
        UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(postParameters);
        request.setEntity(formEntity);
        HttpResponse response = client.execute(request);
        in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));

        StringBuffer sb = new StringBuffer("");
        String line = "";
        String NL = System.getProperty("line.separator");
        while ((line = in.readLine()) != null) {
            sb.append(line + NL);
        }
        in.close();

        String result = sb.toString();
        return result;
    } finally {
        if (in != null) {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

/**
 * Performs an HTTP GET request to the specified url.
 *
 * @param url The web address to post the request to
 * @return The result of the request
 * @throws Exception
 */
public static String executeHttpGet(String url) throws Exception {
    BufferedReader in = null;
    try {
        HttpClient client = getHttpClient();
        HttpGet request = new HttpGet();
        request.setURI(new URI(url));
        HttpResponse response = client.execute(request);
        in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));

        StringBuffer sb = new StringBuffer("");
        String line = "";
        String NL = System.getProperty("line.separator");
        while ((line = in.readLine()) != null) {
            sb.append(line + NL);
        }
        in.close();

        String result = sb.toString();
        return result;
    } finally {
        if (in != null) {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
导入java.io.BufferedReader;
导入java.io.IOException;
导入java.io.InputStreamReader;
导入java.net.URI;
导入java.util.ArrayList;
导入org.apache.http.HttpResponse;
导入org.apache.http.NameValuePair;
导入org.apache.http.client.HttpClient;
导入org.apache.http.client.entity.UrlEncodedFormEntity;
导入org.apache.http.client.methods.HttpGet;
导入org.apache.http.client.methods.HttpPost;
导入org.apache.http.conn.params.ConnManagerParams;
导入org.apache.http.impl.client.DefaultHttpClient;
导入org.apache.http.params.HttpConnectionParams;
导入org.apache.http.params.HttpParams;
公共类CustomHttpClient{
/**客户端超时所需的时间*/
公共静态最终整数HTTP_超时=30*1000;//毫秒
/**我们的HttpClient的单个实例*/
专用静态HttpClient mHttpClient;
/**
*获取HttpClient对象的单个实例。
*
*@返回设置了连接参数的HttpClient对象
*/
私有静态HttpClient getHttpClient(){
if(mHttpClient==null){
mHttpClient=新的DefaultHttpClient();
最终HttpParams params=mHttpClient.getParams();
setConnectionTimeout(参数,HTTP_超时);
HttpConnectionParams.setSoTimeout(参数,HTTP_超时);
setTimeout(参数,HTTP_超时);
}
返回mHttpClient;
}
/**
*使用
*指定的参数。
*
*@param url发布请求的网址
*@param postParameters通过请求发送的参数
*@返回请求的结果
*@抛出异常
*/
公共静态字符串executeHttpPost(字符串url、ArrayList后参数)引发异常{
BufferedReader in=null;
试一试{
HttpClient=getHttpClient();
HttpPost请求=新的HttpPost(url);
UrlEncodedFormEntity formEntity=新的UrlEncodedFormEntity(后参数);
请求。setEntity(formEntity);
HttpResponse response=client.execute(请求);
in=新的BufferedReader(新的InputStreamReader(response.getEntity().getContent());
StringBuffer sb=新的StringBuffer(“”);
字符串行=”;
字符串NL=System.getProperty(“line.separator”);
而((line=in.readLine())!=null){
sb.追加(行+NL);
}
in.close();
字符串结果=sb.toString();
返回结果;
}最后{
if(in!=null){
试一试{
in.close();
}捕获(IOE异常){
e、 printStackTrace();
}
}
}
}
/**
*对指定的url执行HTTP GET请求。
*
*@param url发布请求的网址
*@返回请求的结果
*@抛出异常
*/
公共静态字符串executeHttpGet(字符串url)引发异常{
BufferedReader in=null;
试一试{
HttpClient=getHttpClient();
HttpGet请求=新建HttpGet();
setURI(新的URI(url));
HttpResponse response=client.execute(请求);
in=新的BufferedReader(新的InputStreamReader(response.getEntity().getContent());
StringBuffer sb=新的StringBuffer(“”);
字符串行=”;
字符串NL=System.getProperty(“line.separator”);
而((line=in.readLine())!=null){
sb.追加(行+NL);
}
in.close();
字符串结果=sb.toString();
返回结果;
}最后{
if(in!=null){
试一试{
in.close();
}捕获(IOE异常){
e、 printStackTrace();
}
}
}
}
}

字符串url=(“http://www.avayainfoways.com/hetal/android/index.php?test=“+leadboard.this.test+”&testnm=“+leadboard.this.testFile”);
//字符串url=(“http://www.avayainfoways.com/hetal/android/index.php?test=MATHS&testnm=Maths_1");
//response=myuri.toString().trim();
Log.d(“URL”,URL);
//向url发出请求并获得响应
//字符串jsonStr=sh.makeServiceCall(url,ServiceHandler.GET);
字符串jsons=CustomHttpClient.executeHttpGet(url);
Log.d(“响应:”、“>”+jsons);
if(jsons!=null)
{
试一试{
JSONObject jsonObj=新的JSONObject(jsons);
//获取JSON数组节点
contacts=jsonObj.getJSONArray(TAG_contacts);
//通过所有触点循环
对于(int i=0;ivalue
联系方式:放置(标签、电子邮件、电子邮件);
触点放置(标签测试、测试);
触点。put(TAG_TESTNM,TESTNM);
联系方式(TAG_分数,分数+分数);
//将联系人添加到联系人列表
联系人列表。添加(联系人);
}
}
捕获(JSONException e)
{
58:00.251: I/Choreographer(5133): Skipped 50 frames!  The application may be doing too much work on its main thread.
12-11 08:58:01.021: I/Choreographer(5133): Skipped 200 frames!  The application may be doing too much work on its main thread.
12-11 08:58:01.851: I/Choreographer(5133): Skipped 31 frames!  The application may be doing too much work on its main thread.
12-11 08:58:02.231: I/Choreographer(5133): Skipped 69 frames!  The application may be doing too much work on its main thread.
12-11 08:58:03.751: I/Choreographer(5133): Skipped 52 frames!  The application may be doing too much work on its main thread.
12-11 08:58:03.971: I/Choreographer(5133): Skipped 55 frames!  The application may be doing too much work on its main thread.
12-11 08:58:04.331: I/Choreographer(5133): Skipped 48 frames!  The application may be doing too much work on its main thread.
12-11 08:58:04.491: I/Choreographer(5133): Skipped 34 frames!  The application may be doing too much work on its main thread.
12-11 08:58:04.641: I/Choreographer(5133): Skipped 37 frames!  The application may be doing too much work on its main thread.
12-11 08:58:04.851: I/Choreographer(5133): Skipped 54 frames!  The application may be doing too much work on its main thread.
12-11 08:58:05.141: I/Choreographer(5133): Skipped 63 frames!  The application may be doing too much work on its main thread.
12-11 08:58:05.391: I/Choreographer(5133): Skipped 37 frames!  The application may be doing too much work on its main thread.
12-11 08:58:05.791: I/Choreographer(5133): Skipped 42 frames!  The application may be doing too much work on its main thread.
12-11 08:58:05.931: I/Choreographer(5133): Skipped 35 frames!  The application may be doing too much work on its main thread.
12-11 08:58:06.341: I/Choreographer(5133): Skipped 105 frames!  The application may be doing too much work on its main thread.
12-11 08:58:06.531: I/Choreographer(5133): Skipped 49 frames!  The application may be doing too much work on its main thread.
12-11 08:58:06.791: I/Choreographer(5133): Skipped 68 frames!  The application may be doing too much work on its main thread.
12-11 08:58:07.051: I/Choreographer(5133): Skipped 58 frames!  The application may be doing too much work on its main thread.
12-11 08:58:07.301: I/Choreographer(5133): Skipped 34 frames!  The application may be doing too much work on its main thread.
12-11 08:58:07.521: I/Choreographer(5133): Skipped 43 frames!  The application may be doing too much work on its main thread.
12-11 08:58:07.651: I/Choreographer(5133): Skipped 32 frames!  The application may be doing too much work on its main thread.
12-11 08:58:08.721: D/dalvikvm(5133): GC_CONCURRENT freed 251K, 9% free 4257K/4632K, paused 77ms+14ms, total 199ms
12-11 08:58:12.631: D/dalvikvm(5133): GC_CONCURRENT freed 405K, 11% free 4374K/4900K, paused 76ms+89ms, total 280ms
12-11 08:58:16.161: D/dalvikvm(5133): GC_CONCURRENT freed 545K, 14% free 4373K/5040K, paused 77ms+89ms, total 326ms
12-11 08:58:16.772: D/Single Product Details(5133): {"product":[{"created_at":"2013-11-04 02:43:45","number":null,"pid":"1","updated_at":"0000-00-00 00:00:00","description":"This is the prediction for destiny number 1."}],"success":1}
12-11 08:58:16.772: D/Single Product Details(5133): {"product":[{"created_at":"2013-11-04 02:45:57","talent":"This is the prediction for talent number 8.","number":"8","pid":"8","updated_at":"0000-00-00 00:00:00","description":"This is the prediction for destiny number 8."}],"success":1}
12-11 08:58:16.811: D/Single Product Details(5133): {"product":[{"heartnumber":"5","updated_at":"0000-00-00 00:00:00","heart":"This is the prediction for heart number 5.","description":"This is the prediction for destiny number 5.","created_at":"2013-11-04 02:45:22","talent":"This is the prediction for talent number 5.","number":"5","pid":"5"}],"success":1}
12-11 08:58:16.841: D/Single Product Details(5133): {"product":[{"created_at":"2013-11-11 22:24:52","pid":"5","updated_at":"0000-00-00 00:00:00","personality":"This is the prediction for Personality Number 5.","personalitynumber":"5"}],"success":1}
12-11 08:58:16.871: D/Single Product Details(5133): {"product":[{"created_at":"2013-11-11 22:28:18","menp":"This is the prediction for Minor Expression Number 11.","pid":"11","updated_at":"0000-00-00 00:00:00","men":"11","personality":"This is the prediction for Personality Number 11.","personalitynumber":"11"}],"success":1}
12-11 08:58:16.911: D/Single Product Details(5133): {"product":[{"menp":"This is the prediction for Minor Expression Number 1.","updated_at":"0000-00-00 00:00:00","created_at":"2013-11-11 22:19:51","pid":"1","men":"1","mhd":"This is the prediction for Minor Heart Desire Number 1.","personality":"This is the prediction for Personality Number 1.","mhdnumber":"1","personalitynumber":"1"}],"success":1}
12-11 08:58:16.941: D/Single Product Details(5133): {"product":[{"menp":"This is the prediction for Minor Expression Number 1.","updated_at":"0000-00-00 00:00:00","created_at":"2013-11-11 22:19:51","pid":"1","mpnumber":"1","men":"1","mpn":"This is the prediction for Minor Personality Number 1.","mhd":"This is the prediction for Minor Heart Desire Number 1.","personality":"This is the prediction for Personality Number 1.","mhdnumber":"1","personalitynumber":"1"}],"success":1}
12-11 08:58:16.981: D/Single Product Details(5133): {"product":[{"pinnacle":"This is the prediction for the Pinnacle Number 1","created_at":"2013-11-23 03:05:21","pid":"1","updated_at":"0000-00-00 00:00:00","challenge":"This is the prediction for Challenge number 1.","pinnum":"1","chnum":"1"}],"success":1}
12-11 08:58:17.003: D/Single Product Details(5133): {"product":[{"pinnacle":"This is the prediction for Pinnacle Number 5.","created_at":"2013-11-23 03:08:57","pid":"5","updated_at":"0000-00-00 00:00:00","challenge":"This is the prediction for Challenge Number 5.","pinnum":"5","chnum":"5"}],"success":1}
12-11 08:58:17.012: D/Single Product Details(5133): {"message":"No product found","success":0}
12-11 08:58:17.025: D/Single Product Details(5133): {"message":"No product found","success":0}
12-11 08:58:17.061: D/Single Product Details(5133): {"message":"No product found","success":0}
12-11 08:58:17.091: D/Single Product Details(5133): {"product":[{"lieno":"7","hrpeno":"7","heartpersonality":"This is the prediction for Heart Desire\/Expression Bridge number 7.","lifepathexpression":"This is the prediction for LifePath\/Expression Bridge number 7.","updated_at":"0000-00-00 00:00:00","expressionheart":"This is the prediction for Heart Desire\/Expression Bridge number 7.","created_at":"2013-11-27 01:07:06","pid":"8","exheno":"7"}],"success":1}
12-11 08:58:17.121: D/Single Product Details(5133): {"product":[{"lieno":"0","hrpeno":"0","heartpersonality":"This is the prediction for Heart Desire\/Personality Bridge number 0.","lifepathexpression":"This is the prediction for Life Path\/Expression Bridge number 0.","updated_at":"0000-00-00 00:00:00","expressionheart":"This is the prediction for Heart Desire\/Expression Bridge number 0.","created_at":"2013-11-27 01:01:20","pid":"1","exheno":"0"}],"success":1}
12-11 08:58:17.161: D/Single Product Details(5133): {"product":[{"lieno":"4","hrpeno":"4","heartpersonality":"This is the prediction for Heart Desire\/Personality Bridge number 4.","lifepathexpression":"This is the prediction for LifePath\/Expression Bridge number 4.","updated_at":"0000-00-00 00:00:00","expressionheart":"This is the prediction for Heart Desire\/Expression Bridge number 4.","created_at":"2013-11-27 01:05:27","pid":"5","exheno":"4"}],"success":1}
12-11 08:58:17.201: D/Single Product Details(5133): {"product":[{"updated_at":"0000-00-00 00:00:00","pyno":"5","pdyno":"5","pmnno":"5","pdaynumber":"This is the prediction for Personal Day Number 5.","pmonthnumber":"This is the prediction for Personal Month Number 5.","pyearnumber":"This is the prediction for Personal Year Number 5.","created_at":"2013-11-28 01:16:49","rthoughtnumber":"This is the prediction for Relational Thought Number 5.","pid":"5","rthno":"5"}],"success":1}
12-11 08:58:17.231: D/Single Product Details(5133): {"product":[{"updated_at":"0000-00-00 00:00:00","pyno":"11","pdyno":"11","pmnno":"11","pdaynumber":"This is the prediction for Personal Day Number 11.","pmonthnumber":"This is the prediction for Personal Month Number 11.","pyearnumber":"This is the prediction for Personal Year Number 11.","created_at":"2013-11-28 01:23:11","rthoughtnumber":"This is the prediction for Relational Thought Number 11.","pid":"10","rthno":"11"}],"success":1}
12-11 08:58:17.262: D/Single Product Details(5133): {"product":[{"updated_at":"0000-00-00 00:00:00","pyno":"5","pdyno":"5","pmnno":"5","pdaynumber":"This is the prediction for Personal Day Number 5.","pmonthnumber":"This is the prediction for Personal Month Number 5.","pyearnumber":"This is the prediction for Personal Year Number 5.","created_at":"2013-11-28 01:16:49","rthoughtnumber":"This is the prediction for Relational Thought Number 5.","pid":"5","rthno":"5"}],"success":1}
12-11 08:58:17.291: D/Single Product Details(5133): {"product":[{"updated_at":"0000-00-00 00:00:00","pyno":"7","pdyno":"7","pmnno":"7","pdaynumber":"This is the prediction for Personal Day Number 7.","pmonthnumber":"This is the prediction for Personal Month Number 7.","pyearnumber":"This is the prediction for Personal Year Number 7.","created_at":"2013-11-28 01:18:33","rthoughtnumber":"This is the prediction for Relational Thought Number 7.","pid":"7","rthno":"7"}],"success":1}
12-11 08:58:17.301: D/Single Product Details(5133): {"product":[{"balance":"This is the prediction for the Balance Number 1.","karmic":"This is the prediction for the Karmic Lesson 1.","klno":"1","updated_at":"0000-00-00 00:00:00","blno":"1","created_at":"2013-11-29 04:17:10","pid":"1","scno":"1","subconcious":"This is the prediction for the Sub-Concious Self 1.","hiddenpassion":"This is the prediction for the Hidden Passion 1.","hpno":"1"}],"success":1}
12-11 08:58:17.321: D/Single Product Details(5133): {"product":[{"balance":"This is the prediction for the Balance Number 3.","karmic":"This is the prediction for the Karmic Lesson 3.","klno":"3","updated_at":"0000-00-00 00:00:00","blno":"3","created_at":"2013-11-29 04:19:31","pid":"3","scno":"3","subconcious":"This is the prediction for the Sub-Concious Self 3.","hiddenpassion":"This is the prediction for the Hidden Passion Number 3.","hpno":"3"}],"success":1}
12-11 08:58:18.811: I/Choreographer(5133): Skipped 183 frames!  The application may be doing too much work on its main thread.
12-11 08:58:18.981: I/Choreographer(5133): Skipped 31 frames!  The application may be doing too much work on its main thread.
12-11 08:58:20.911: I/Choreographer(5133): Skipped 38 frames!  The application may be doing too much work on its main thread.
12-11 08:58:21.071: I/Choreographer(5133): Skipped 30 frames!  The application may be doing too much work on its main thread.
12-11 08:58:22.151: I/Choreographer(5133): Skipped 103 frames!  The application may be doing too much work on its main thread.
12-11 08:58:22.301: I/Choreographer(5133): Skipped 30 frames!  The application may be doing too much work on its main thread.
12-11 08:58:22.661: I/Choreographer(5133): Skipped 79 frames!  The application may be doing too much work on its main thread.
12-11 08:58:22.972: I/Choreographer(5133): Skipped 59 frames!  The application may be doing too much work on its main thread.
12-11 08:58:23.721: I/Choreographer(5133): Skipped 31 frames!  The application may be doing too much work on its main thread.
12-11 08:58:23.951: I/Choreographer(5133): Skipped 42 frames!  The application may be doing too much work on its main thread.
12-11 08:58:24.242: I/Choreographer(5133): Skipped 44 frames!  The application may be doing too much work on its main thread.
12-11 08:58:25.291: I/Choreographer(5133): Skipped 33 frames!  The application may be doing too much work on its main thread.
12-11 08:58:25.601: I/Choreographer(5133): Skipped 33 frames!  The application may be doing too much work on its main thread.
12-11 08:58:25.761: I/Choreographer(5133): Skipped 42 frames!  The application may be doing too much work on its main thread.
12-11 08:58:25.912: I/Choreographer(5133): Skipped 38 frames!  The application may be doing too much work on its main thread.
12-11 08:58:26.881: I/Choreographer(5133): Skipped 42 frames!  The application may be doing too much work on its main thread.
12-11 08:58:27.163: I/Choreographer(5133): Skipped 39 frames!  The application may be doing too much work on its main thread.
12-11 08:58:27.451: I/Choreographer(5133): Skipped 39 frames!  The application may be doing too much work on its main thread.
12-11 08:58:28.322: I/Choreographer(5133): Skipped 62 frames!  The application may be doing too much work on its main thread.
12-11 08:58:28.551: I/Choreographer(5133): Skipped 34 frames!  The application may be doing too much work on its main thread.
12-11 08:58:28.711: I/Choreographer(5133): Skipped 42 frames!  The application may be doing too much work on its main thread.
12-11 08:58:28.872: I/Choreographer(5133): Skipped 31 frames!  The application may be doing too much work on its main thread.
12-11 08:58:31.291: I/Choreographer(5133): Skipped 36 frames!  The application may be doing too much work on its main thread.
12-11 08:58:31.591: I/Choreographer(5133): Skipped 44 frames!  The application may be doing too much work on its main thread.
12-11 08:58:31.813: I/Choreographer(5133): Skipped 38 frames!  The application may be doing too much work on its main thread.
12-11 08:58:31.971: I/Choreographer(5133): Skipped 40 frames!  The application may be doing too much work on its main thread.
12-11 08:58:32.131: I/Choreographer(5133): Skipped 31 frames!  The application may be doing too much work on its main thread.
12-11 08:58:32.761: I/Choreographer(5133): Skipped 58 frames!  The application may be doing too much work on its main thread.
12-11 08:58:32.981: I/Choreographer(5133): Skipped 31 frames!  The application may be doing too much work on its main thread.
12-11 08:58:33.251: I/Choreographer(5133): Skipped 31 frames!  The application may be doing too much work on its main thread.
12-11 08:58:34.721: I/Choreographer(5133): Skipped 43 frames!  The application may be doing too much work on its main thread.
12-11 08:58:34.881: I/Choreographer(5133): Skipped 40 frames!  The application may be doing too much work on its main thread.
12-11 08:58:35.041: I/Choreographer(5133): Skipped 30 frames!  The application may be doing too much work on its main thread.
12-11 08:58:35.212: I/Choreographer(5133): Skipped 44 frames!  The application may be doing too much work on its main thread.
12-11 08:58:35.351: I/Choreographer(5133): Skipped 35 frames!  The application may be doing too much work on its main thread.
12-11 08:58:35.482: I/Choreographer(5133): Skipped 33 frames!  The application may be doing too much work on its main thread.
12-11 08:58:36.492: I/Choreographer(5133): Skipped 30 frames!  The application may be doing too much work on its main thread.
12-11 08:58:39.071: I/Choreographer(5133): Skipped 71 frames!  The application may be doing too much work on its main thread.
12-11 08:58:39.321: I/Choreographer(5133): Skipped 43 frames!  The application may be doing too much work on its main thread.
12-11 08:58:39.611: I/Choreographer(5133): Skipped 63 frames!  The application may be doing too much work on its main thread.
12-11 08:58:39.981: I/Choreographer(5133): Skipped 45 frames!  The application may be doing too much work on its main thread.
12-11 08:58:40.271: I/Choreographer(5133): Skipped 36 frames!  The application may be doing too much work on its main thread.
12-11 08:58:40.572: I/Choreographer(5133): Skipped 61 frames!  The application may be doing too much work on its main thread.
12-11 08:58:40.801: I/Choreographer(5133): Skipped 35 frames!  The application may be doing too much work on its main thread.
12-11 08:58:40.971: I/Choreographer(5133): Skipped 34 frames!  The application may be doing too much work on its main thread.
12-11 08:58:41.151: I/Choreographer(5133): Skipped 36 frames!  The application may be doing too much work on its main thread.
12-11 08:58:41.481: I/Choreographer(5133): Skipped 44 frames!  The application may be doing too much work on its main thread.
12-11 08:58:42.571: I/Choreographer(5133): Skipped 33 frames!  The application may be doing too much work on its main thread.
12-11 08:58:42.861: I/Choreographer(5133): Skipped 35 frames!  The application may be doing too much work on its main thread.
12-11 08:58:44.141: I/Choreographer(5133): Skipped 43 frames!  The application may be doing too much work on its main thread.
12-11 08:58:44.291: I/Choreographer(5133): Skipped 30 frames!  The application may be doing too much work on its main thread.
12-11 08:58:44.831: I/Choreographer(5133): Skipped 30 frames!  The application may be doing too much work on its main thread.
12-11 08:58:45.021: I/Choreographer(5133): Skipped 46 frames!  The application may be doing too much work on its main thread.
12-11 08:58:45.201: I/Choreographer(5133): Skipped 34 frames!  The application may be doing too much work on its main thread.
12-11 08:58:45.371: I/Choreographer(5133): Skipped 45 frames!  The application may be doing too much work on its main 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.ArrayList;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;

public class CustomHttpClient {
/** The time it takes for our client to timeout */
public static final int HTTP_TIMEOUT = 30 * 1000; // milliseconds

/** Single instance of our HttpClient */
private static HttpClient mHttpClient;

/**
 * Get our single instance of our HttpClient object.
 *
 * @return an HttpClient object with connection parameters set
 */
private static HttpClient getHttpClient() {
    if (mHttpClient == null) {
        mHttpClient = new DefaultHttpClient();
        final HttpParams params = mHttpClient.getParams();
        HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT);
        HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT);
        ConnManagerParams.setTimeout(params, HTTP_TIMEOUT);
    }
    return mHttpClient;
}

/**
 * Performs an HTTP Post request to the specified url with the
 * specified parameters.
 *
 * @param url The web address to post the request to
 * @param postParameters The parameters to send via the request
 * @return The result of the request
 * @throws Exception
 */
public static String executeHttpPost(String url, ArrayList<NameValuePair> postParameters) throws Exception {
    BufferedReader in = null;
    try {
        HttpClient client = getHttpClient();
        HttpPost request = new HttpPost(url);
        UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(postParameters);
        request.setEntity(formEntity);
        HttpResponse response = client.execute(request);
        in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));

        StringBuffer sb = new StringBuffer("");
        String line = "";
        String NL = System.getProperty("line.separator");
        while ((line = in.readLine()) != null) {
            sb.append(line + NL);
        }
        in.close();

        String result = sb.toString();
        return result;
    } finally {
        if (in != null) {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

/**
 * Performs an HTTP GET request to the specified url.
 *
 * @param url The web address to post the request to
 * @return The result of the request
 * @throws Exception
 */
public static String executeHttpGet(String url) throws Exception {
    BufferedReader in = null;
    try {
        HttpClient client = getHttpClient();
        HttpGet request = new HttpGet();
        request.setURI(new URI(url));
        HttpResponse response = client.execute(request);
        in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));

        StringBuffer sb = new StringBuffer("");
        String line = "";
        String NL = System.getProperty("line.separator");
        while ((line = in.readLine()) != null) {
            sb.append(line + NL);
        }
        in.close();

        String result = sb.toString();
        return result;
    } finally {
        if (in != null) {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
        String url=("http://www.avayainfoways.com/hetal/android/index.php?test=" + LeaderBoard.this.test + "&testnm=" +  LeaderBoard.this.testFile);
            //String url=("http://www.avayainfoways.com/hetal/android/index.php?test=MATHS&testnm=Maths_1");
            //response=myuri.toString().trim();
            Log.d("URL",url);
        // Making a request to url and getting response
        //String jsonStr = sh.makeServiceCall(url, ServiceHandler.GET);
        String jsons = CustomHttpClient.executeHttpGet(url);

        Log.d("Response: ", "> " + jsons);

        if (jsons != null) 
        {
            try {
                JSONObject jsonObj = new JSONObject(jsons);

                // Getting JSON Array node
                contacts = jsonObj.getJSONArray(TAG_CONTACTS);

                // looping through All Contacts
                for (int i = 0; i < contacts.length(); i++) {
                    JSONObject c = contacts.getJSONObject(i);

                    String email = c.getString(TAG_EMAIL);
                    String test = c.getString(TAG_TEST);
                    String testnm = testname;
                    String score = c.getString(TAG_SCORE);



                    // tmp hashmap for single contact
                    HashMap<String, String> contact = new HashMap<String, String>();

                    // adding each child node to HashMap key => value
                    contact.put(TAG_EMAIL, email);
                    contact.put(TAG_TEST, test);
                    contact.put(TAG_TESTNM, testnm);
                    contact.put(TAG_SCORE, score+" Marks");

                    // adding contact to contact list
                    contactList.add(contact);
                }
            }
            catch (JSONException e)
            {
                e.printStackTrace();
            }
        } 
        else
        {
            Log.e("ServiceHandler", "Couldn't get any data from the url");
        }
   } catch (Exception e)
   {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
   finally
   {

   }
      return null;
}