Syncing data in Android app
<p>I'm developing an app that syncs different data through JSON in almost every Activity. This data could be manipulated by other devices so I have to keep it updated whenever possible.</p>

<p>For example, in the first Activity I login to the webservice, and in the next Activity I use AsyncTask to download a JSON that tells me all car models in the store, and use that info to create a ListView. Clicking on one row, I call another AsyncTask to download specific information (JSON) about that car, and get for example information about it's tires. In the next activity I'm calling another AsyncTask to get specific info about those tires. Most of the time, required info to be used in the next Activity is stored in SharedPreferences, because I have no idea how to have ArrayLists accessible in the entire app, and I don't know if it's going to utilize a lot of RAM. And if it is a good idea to share so many objects through the app.</p>

<p>You can see that everytime my Activity is reloaded, the AsyncTask checks the connection and download new data to be displayed. The service doesn't support push so I guess I have the responsibility to check it every time, correct?</p>

<p>Another thing to consider is that data downloaded can be changed and in that case, I have to upload the JSON, and refresh the views accordingly. In this aspect I have no idea how to save "changes" to be uploaded when the connection is down. Like, creating a queued list of unsynced tasks.</p>

<p>The result is an app that is heavily dependent on the internet connectivity and feels slow every time an Activity is resumed.</p>

<p>For most part I instantiate a new ArrayList of objects (Car, Tires, etc), but I'm confused how to properly sync data back in JSON if everything is now an object. Maybe using GJON?</p>

<p>I really need some tips about how to manage apps like this.</p>

<p>Thanks</p>
