Issue
I have to build an app that downloads its configuration (branding, menus, ...) at app start. I'll have several different activities, but the configuration needs to be available for every activity.
Question is: When do I download this configuration and how can I maintain a suitable lifecycle and access (for activities) to it?
Any best practices?
Solution
What we use to do in this case is -
- Download all Configuration while loading Splash Screen of app first time.
- And than can save all these in
SQLiteDBor inSharedPreferences. - After that, for each time app your runs, you must check for internet connectivity,
IF is exists you SHOULD go for download configuration IF required for updates/modifications) OR you should fetch these from
SQLiteDB/SharedPreferences. - Now, you can access
SQLiteDB/SharedPreferencesfrom all your activities to use data.
Hope it helps, and let me know if yours use case is different..
Answered By - Kanak Sony
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.