I’ve just started my app in android.And i want my app should not consume much CPU of device.
I have 3 choice for data accessing .
1 . MySQL Database on remote server.
2 . Data stored in form of xml on remote server
3 . Data stored in form of json on remote server.
Data is approx 2000-3000 rows in database.
Which approach should i use for better performance of my app.
Any help will be appreciable.
How your data is stored on the remote server is of little concern to the android app. The real question is how it’s transferred, and how you handle and store it locally.
With this much data, your best bet is to use to stream the data and parse the stream. For XML, that would mean using the SAX parser, for JSON probably streaming Jackson. JSON uses less bandwidth and Jackson is hands-down the fastest way to churn through formatted data.
Streaming has the obvious advantage that you do not need to keep all this data in memory to parse as DOM, but it comes at the cost of a higher development effort.
Locally, the best way to store this amount of data would be a sqlite database, which you can easily query.