문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top