How to add value and store in Shared preference in android
<p>I have an app in which I send server request and in response server gives me some data, At this point I want to store in <code>SharedPreference</code>.</p>

<p>In next server request I again find the length of data coming in response from server, at this point of time I want this length to add with previous save value in preference and same process again and again.</p>

<p><strong>Code for finding server response length:</strong></p>

<pre><code>JSONArray posts = response.optJSONArray("data");
int arrayCount = posts.length();
</code></pre>