Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
305 views
in Technique[技术] by (71.8m points)

android - What happens to a Sqlite database when app is removed

I'm new to Android programming and trying to wrap my head around this just to make myself clear about how things work.

When creating Sqlite databases in an Android app, where is the database stored? Does it get deleted when the app is removed? Any info about this would be much helpful in understanding Android programming for people coming from a web development background.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

SQlite databases are just files, and they're treated like any other file: they're stored (by default) in the application's private data area (/data/data/$PACKAGENAME/databases). They're deleted along with everything else in the application's private data area.

You can create a database on the SD card if you like. They, of course, won't be removed on uninstallation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...