1

I am new to Android development and am creating a "ToDoList" app in Android.

I used a SQLlite database to save the list in a database table, and it saved data perfectly.

I don't have an Android phone, so I can check my application only using an emulator.

After saving tasks in the database, if a user restarts the phone then will my task list in database be deleted or not? If it will be deleted then how can I make the data in the table persistent?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Durga Dutt
  • 4,093
  • 11
  • 33
  • 48

2 Answers2

3

The table definitely stays if the user simply reboots the phone. Off the top of my head, I think the only way to get rid of the table completely is to either:

  • Delete it (programmatically or via the sql command line)
  • Uninstall the application

Simply upgrading your application to a new version will not delete your existing tables (so long as you use the same keystore when making the APK.)

-- Dan

debracey
  • 6,517
  • 1
  • 30
  • 56
0

For saving persistent application data Android offers various options.

A comparison between SQLite and SharedPreferences for storing persistent data.

Considering you are developing a ToDoList app for Android, I would recommend sticking to SQLite.

Community
  • 1
  • 1
Primal Pappachan
  • 25,857
  • 22
  • 67
  • 84