How to parse JSON object from a website into an arraylist in android

后端 未结 5 1004
广开言路
广开言路 2021-01-07 09:55

How can I parse a JSON object from a weblink into Android and store the different values into ArrayLists?

The JSON object of users looks like the below. It comes fro

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-07 10:15

    DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(HttpUtil.BASIC_URL
                    + HttpUtil.SUBSCRIPTION_URL);
            try{
                if (cookie != null) {
                   // httpClient.setCookieStore(LoginJsonUtil.cookie);
                    List nameValuePair = new ArrayList(2);
                    nameValuePair.add(new BasicNameValuePair("uid",
                            uid));
                    nameValuePair.add(new BasicNameValuePair("subscriptionslist[pageindex]",
                            subscriptionslist_pageindex));
                    nameValuePair.add(new BasicNameValuePair("subscriptionslist[recordlimit]",
                            subscriptionslist_recordlimit));
                    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
    

提交回复
热议问题