Additional synchronous initialization
Hi, What do you think about synchronous initialization? I know that you rewrite it to async, but in my case I need it to be synchronous.
For example, I want to keep all data in memory and I load everything at application start. With async model when we upgrade to a new database version we can easily get empty set, as we can select from table not filled from tmp_table yet.
Right now I solve this with CountDownLatch, that's not what I want, of course :)
I understand that this could slow down start of my app, but it's ok for me. So maybe it's not bad to add synchronous init possibility? Async by default, and sync for advanced using.
I just wanted to know what do you think about this idea. I could try to implement this and send you pull request.
Hi,
Doing the upgrade on the main thread will have more consequences than just delaying the user. You might see the "App not responding dialog" presented by the OS.
You can set an InitializeListener on the AndroidInitializeConfig used when you start the library. This will give you a callback when it's ready to use. You would be better implementing this and manually blocking your app from showing the first screen with a "splash screen" style activity.
Thanks