When using offline sync with Azure Mobile Services Android SDK, do I need to call MobileServiceSyncContext.initialize in each Activity that requires access to some table? If so, why? The local database shouldn't be initialized only once? Am I doing all wrong? Every time the method initialize is called it tries to create all tables again even if they already exist, for me it is not so good. Is there any way I can initialize the syncContext only once or at least avoid the framework running sql scripts to create tables every time the syncContext is initialized?
Thank you!
PS: I'm a newbie in Android development, so be nice :)
According to your description, based on my understanding, it seems that you has follow some documents and samples below to create your app using offline sync data feature.
Per my experience & according to the javadocs of Azure Mobile Apps SDK for Android, I think you can try to add the code using the method
MobileServiceSyncContext.isInitalizedbelow for checking theMobileServiceSyncContextinitialization status, based on the sample code as below, to avoid duplicate the initalization operation.