I hope you managed to obtain the json data from the json string.
Well I think this will be of help
try {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(urls[0])
.build();
Response responses = null;
try {
responses = client.newCall(request).execute();
} catch (IOException e) {
e.printStackTrace();
}
String jsonData = responses.body().string();
JSONObject Jobject = new JSONObject(jsonData);
JSONArray Jarray = Jobject.getJSONArray("employees");
//define the strings that will temporary store the data
String fname,lname;
//get the length of the json array
int limit = Jarray.length()
//datastore array of size limit
String dataStore[] = new String[limit];
for (int i = 0; i < limit; i++) {
JSONObject object = Jarray.getJSONObject(i);
fname = object.getString("firstName");
lname = object.getString("lastName");
Log.d("JSON DATA", fname + " ## " + lname);
//store the data into the array
dataStore[i] = fname + " ## " + lname;
}
//prove that the data was stored in the array
for (String content ; dataStore ) {
Log.d("ARRAY CONTENT", content);
}
Remember to use AsyncTask or SyncAdapter(IntentService), to prevent getting a NetworkOnMainThreadException
Also import the okhttp library in your build.gradle
compile 'com.squareup.okhttp:okhttp:2.4.0'