开发者

Updating only SQLite database file of application without replacing application code and other files on air

开发者 https://www.devze.com 2023-03-28 19:43 出处:网络
I am developing an android application with inbuilt SQLite database. I need to replace SQLite database file only every 3 months. while doing this I should not alter any part of code.

I am developing an android application with inbuilt SQLite database. I need to replace SQLite database file only every 3 months. while doing this I should not alter any part of code.

Also I don't want to do this as upgrading application where changing app version I can replace old application with newer version and new database.

For example if I give a button "Update Database" and after clicking this button only database file is replaced using internet and other parts of application remains intac开发者_Python百科t.


simply do as you'd do with any file:

  1. Download the database file from a web server to the devices temp directory (or cache or SDCard)
  2. Move that file to your application's data directory

To do that automatically, you should use a service started by the AlarmManager.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号