Domain/Android 2012.10.10 12:03
In case that sqlite database is quite big, preparation for using cursor requires lots of time-consuming-operation.
So, developer may considering about asynchronous way - showing progress while preparing cursor in background.
Then, what is 'Really' time-consuming-operation in preparing cursor?
As my understanding, in Android sqlite cursor, the answer is first 'fillWindow' operation of SQLiteCursor.
Notable thing is, at sqlite cursor, creating cursor doesn't do any real (or practical) thing.
So, creating cursor is done very quickly.
By the way, Sqlite cursor do 'fillWindow' operation at the moment of first 'getCount()' call - See SQLiteCursor.java.
Therefore, to prepare cursor in background, not only creating cursor but also calling first 'getCount()' function are required.
Here is sample function for reference.
|[Android] MediaPlayer with SurfaceHolder (0)||2012.10.18|
|[Android] SurfaceView + SlidingDrawer issue (0)||2012.10.17|
|[Android] Using SQLite cursor of quite-big-database asynchronously. (0)||2012.10.10|
|[Android] Issue regarding android:targetSdkVersion. (0)||2012.10.08|
|Policy of Google Play to consider registering App to Android Google Play. (0)||2012.10.04|
|Points to consider for recycling Bitmap of ImageView. (0)||2012.09.21|