Domanda

How gmail app does its loading ? does it use an ArrayAdapter(store the data in memory) or store the data in a sqlLite database as a source for its ListView.

Ps: Nexus 5 got hanged when I kept loading the gmail emails for a long time.

È stato utile?

Soluzione

I definitely use LoaderManager and load the rows from the internal database.

Emails are stored in internal database. You can see the rows and columns of the tables of the database using Root Explorer and proper SQLite viewer.

It also uses SyncAdapter to fill the database from the cloud. This is the most efficient way.

You can check LoaderManager here: http://developer.android.com/guide/components/loaders.html

And if you want to do the same and you want to create ContentProvider with a SQLite database you should try this: https://github.com/TimotheeJeannin/ProviGen

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top