vk api doing the example link text . I get the answer in the form link text How to display only the last name, first name
1 answer
I advise you to use json-simple . There are examples here.
Here is the code for your case:
JSONParser pars = new JSONParser(); Object obj = null; try { obj = pars.parse(response_vk); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } JSONObject response = (JSONObject) obj; JSONArray arr = (JSONArray) response.get("response"); response = (JSONObject) arr.get(0); String last_name = response.get("last_name").toString(); String first_name = response.get("first_name").toString(); |