Create SQLite database in android

前端 未结 8 648
故里飘歌
故里飘歌 2020-11-29 03:12

I want to create a SQLite database in my app, which contains three tables, I will add data into tables and will use them later on.

but I like to keep database ,as if

8条回答
  •  误落风尘
    2020-11-29 03:53

    If you want to keep the database between uninstalls you have to put it on the SD Card. This is the only place that won't be deleted at the moment your app is deleted. But in return it can be deleted by the user every time.

    If you put your DB on the SD Card you can't use the SQLiteOpenHelper anymore, but you can use the source and the architecture of this class to get some ideas on how to implement the creation, updating and opening of a databse.

提交回复
热议问题