Should I create all views at once on app's first launch?


#1

Hi everyone,

I’ve several views around my Android Application (using CBLite) and they are created on demand by fragments and activities.
So at first run, as the user browses the app, there are this annoying lags when the views are used by the first time.
How should I address this issue in order to improve the user’s experience?
1 - Should I create all my views in a splash screen, showing only one progress dialog, or
2 - Should I show a progress dialog for each view creation?

I would like to hear your opinion and suggestions about this.


#2

I’d go with 1.
It’s best to do that when the application starts.

Is the app ever crashing as a result of a long running indexing time? Which version of CBL are you running? Are you seeing this behaviour on a specific platform?

This issue was related to memory consumption https://github.com/couchbase/couchbase-lite-ios/issues/701 and was fixed in 1.1.0.
It looks like in this case using a profiling tool like Instruments helped to understand the source of the issue. If you’re able to do so, it might be good to run a profiling tool on your app.

James


#3

Do you have a big database that’s installed with the app? If so, you can pre-index it when you create the database during development, and then the views won’t need to be re-indexed on launch.