Where is the SQLite database stored on the android phone

1,510 views
Skip to first unread message

manish kumar

unread,
Jul 7, 2011, 3:12:17 AM7/7/11
to phonegap
Hi,

Where is the SQLite database stored on the android phone which we
create in our applications.
Also what is the lifetime of our database in the application i.e till
the app is running or the phone.



If we reboot the phone , will it get wiped out????


Thanks,
CHEERS,
Manish Kumar

Simon MacDonald

unread,
Jul 7, 2011, 9:52:23 AM7/7/11
to phon...@googlegroups.com
The database is stored at:

/data/data/${app package name}/app_database/${DB name}.db

The database file will persist as long as you don't delete it. No, it
won't be wiped on a reboot of the phone.

Simon Mac Donald
http://hi.im/simonmacdonald

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>

manish kumar

unread,
Jul 7, 2011, 11:48:03 AM7/7/11
to phon...@googlegroups.com
thanks simon...
 
also i am doing an app where you need to log in only once i.e untill you log out....even if the app closes you remain logged in....how do i check if you are already logged in or not...
 
 
currently i create a DB when first time the app runs and check on each start if DB exists or not....
 
When someone logs out i change the flag value from 1 to 0...but o restart the SQLite query SELECT * FROM DATA is throwing an error despite the table being existent...
 
can you please help me on this...

Cheers,
Manish Kumar



Simon MacDonald

unread,
Jul 7, 2011, 2:51:49 PM7/7/11
to phon...@googlegroups.com
I guess it all depends on what you sql code looks like.

On Thu, Jul 7, 2011 at 11:48 AM, manish kumar

Reply all
Reply to author
Forward
0 new messages