Storing JSON data to local database in android
<p>Okay so, I created an app that retrieves data from my server using JSON. Now I want to store the retrieved data on my phone's local storage/db. How do I do it? I am new in android programming.</p>

<p>This is the JSON that I receive from the server</p>

<pre><code>{"messages":[{"id":"44","issender":0,"content":"CAT1DOG","date":"Jan 01, 1970 07:30 AM","sender":"Administrator","receiver":"User"},{"id":"57","issender":0,"content":"ttt","date":"Jun 30, 2016 03:43 PM","sender":"Administrator","receiver":"User"},{"id":"58","issender":0,"content":"s","date":"Jun 30, 2016 03:43 PM","sender":"Administrator","receiver":"User"},{"id":"82","issender":0,"content":"yeuwu","date":"Jun 30, 2016 04:59 PM","sender":"Administrator","receiver":"User"}],"success":1}
</code></pre>

<p>and this is my code to parse JSON</p>

<pre><code>for(int i = 0; i &lt; messages.length(); i++){
                        JSONObject o        = messages.getJSONObject(i);
                        String msgid        = o.getString("id");
                        String message      = o.getString("content");
                        String date         = o.getString("date");
                        String sender       = o.getString("sender");
                        String receiver     = o.getString("receiver");
                        String issender     = o.getString("issender");

                        // TEMP HASHMAP FOR USER
                        HashMap&lt;String, String&gt; msgList = new HashMap&lt;String, String&gt;();

                        // ADDING EACH CHILD NOTE TO HASHMAP =&gt; VALUE
                        msgList.put("id", uid);
                        msgList.put("message", message);
                        msgList.put("date", date);
                        msgList.put("name", sender);
                        msgList.put("receivername", receiver);

                        // ADDING USER TO MSGLIST
                        ListOfMsg.add(msgList);
                    }
</code></pre>

<p>Thanks in advance for those who will answers. will appreciate it.</p>