I have a JSON like this in my Android app :
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtZWhkaS5hZ291emFsQGdtYWlsLmNvbSIsImV4cCI6MTQ2ODU1NTU4MjQ5MX0.A6-xNIZdbPv9mpjLO9jnnfbAeq1y-DC08SBUt2xBnYo",
"expires": 1468555582491,
"user": {
"imageURL": "http://app.com/images/null",
"email": "mail@gmail.com",
"firstname": "mister",
"lastname": "lalalala",
"password": "$2a$10$VDGtxjz9w7f170Wc66OJi.1T",
"id": "c19349c4044d34333",
"language": "EN",
"createdAt": "2015-07-07T14:15:54.000Z",
"updatedAt": "2016-05-06T08:25:20.000Z"
}
}
I can access to the "token" like this :
String json = new String(bytes);
JSONObject jsonObj = null;
try {
jsonObj = new JSONObject(json);
} catch (JSONException e) {
e.printStackTrace();
}
Log.d("debug", "TOKEN : " + jsonObj.getString("token"));
But I don't know how to get the user email or firstname for example. How can I do that ?
Thanks