-1
{
    "uau_id": 26,
    "u_id": 6,
    "au_id": 15,
    "element_id": 6,
    "date_created": "2018-06-01T09:38:39.974585Z",
    "users": 6,
    "device_id": "dtvB8TgxmXM:APA91bFnrIhO0rYiX5XSexRKSW9VBAjLiabQwrt4ccgkTbbNEMn5Ltgl-mX1wdZuVhbcX0nx5co1UEyi1Jw11EXnCrLqbgg82BFKTA-yVYiWLfQdLSOr6dM_NUHIx1NZCGPcm08p6Xs4",
    "audittype": 15,
    "infograph": 204
}

This is json response

and I have to save only uau_is and its value in shared prefernece

Hamza Abdaoui
  • 2,029
  • 4
  • 23
  • 36
  • What platform is this about? Is this about Android? Please tag your question with the relevant tags. To update your question, click on the **"[edit]"** link under the post. Thank you. – Pang Jun 09 '18 at 05:27

1 Answers1

0

If you want to store the response the better way is to write the content into a file. If you want to store only some values you can do like this

SharedPreferences.Editor editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit();
 editor.putString("key_from_json", "String_value_from_json");
 editor.putInt("key_from_json","int_value_from_json");
 editor.commit();
wobsoriano
  • 12,348
  • 24
  • 92
  • 162