In android development, and when is it good to use sql lite vs Web server db? If a person delete the app or upgrade my app then will the db get deleted if i use sql lite?
Thank you very much
In android development, and when is it good to use sql lite vs Web server db? If a person delete the app or upgrade my app then will the db get deleted if i use sql lite?
Thank you very much
Use SQLite
. Android comes with good support for it.
Usually the location for the database in Android is:
/data/data/[packagename]/databases
The sqlite database is just a file on the SDCard. It isn't tied to the app, so removing and or updating an app wont affect the database. (unless you wrote update code to update your db :) )
Sqlite is easy to use, compact, and obviously can be stored on your SDCard at ease. The ability to connect to it etc is all done in android.
You only need a web server database if you intend to share information from your app between devices/people. If the data is only necessary for your local device then definately use sqlite.
It won't be deleted. The method onUpgrade will get fired instead so you'll be able to check database versions and perform the proper changes to the current database (updates, data migrations, etc).
About having or not a service in the cloud to which you can sync it's a question that you have to answer yourself. These question could help you realize about the proper answer.
It depends on the application you are building. If you are looking to build an application that will be updating or saving data to a cloud then yes use mysql on a web server. If you are looking to build an application where data will only be available locally on the phone then use SQLite.