0

If I create the SQLite DB and tables with some data at the time of developement then build the apk of that app,Does that tables and data will remain the same when I install that apk on android Device?

asked Aug 16, 2012 at 7:40
1
  • Nope, to do so you have put your DB inside assets folder Commented Aug 16, 2012 at 8:00

4 Answers 4

1

Please see below link for copy database from your assets folder.

Using your own SQLite database in Android applications

answered Aug 16, 2012 at 7:55
Sign up to request clarification or add additional context in comments.

Comments

0

Yes, you should put your DB in the assets folder...

answered Aug 16, 2012 at 7:43

3 Comments

@Feradau,You mean after running the app on emulator i just need to copy paste ma db file from file explorer to the asset folder in project..Is it so?
@Feradau,But if I keep the DB file in asset.Can i access it with normal Database code or we need to change it to anything else
Yes you can access it the normal way. Just open it from /assets/... BTW: it's ferdau
0

That is not the case..your database wont get ported on the device..

answered Aug 16, 2012 at 7:47

Comments

0

The thing that you need to understand is that your application doesn't get ported with a database. It will be created on the device when your application runs for the first time. That's why the onCreated() method runs just once.

Bart
20.1k8 gold badges72 silver badges80 bronze badges
answered Aug 18, 2012 at 2:32

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.