File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Newbie - Best practice for a new .db ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Newbie - Best practice for a new .db ?" Watch "Newbie - Best practice for a new .db ?" New topic
Author

Newbie - Best practice for a new .db ?

Alessandro Camel
Ranch Hand

Joined: Jul 03, 2009
Posts: 35
Hello all,
what is the best pratice in order to have an app working with a sqllite db?
1-Create the db on the PC and put it in the apk ?
2-Using a webservice ?
3-Using a txt file and create the db the first time ?
4-..........
Sorry for the noob question... just starting here!
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Generally the app would create the DB programmatically. See http://developer.android.com/guide/topics/data/data-storage.html#db for links to two example apps that show how to do that.
Alessandro Camel
Ranch Hand

Joined: Jul 03, 2009
Posts: 35
Tim Moores wrote:Generally the app would create the DB programmatically. See http://developer.android.com/guide/topics/data/data-storage.html#db for links to two example apps that show how to do that.


Tim, thanks for the answer, but it's still not clear!

I understand the use of onCreate() and onUpdate(), but I have to insert in the DB about 500 lines.

I can have and xml and read it in the onCreate(), ok; but, also, I can use a webservice and read it once in the same method.
Both of these are working, but which is the "best practice" ? (if there is one!)

Jagadeeswara Yaramala
Ranch Hand

Joined: Jul 28, 2010
Posts: 46
I thought this is of some help...!!
Alessandro Camel
Ranch Hand

Joined: Jul 03, 2009
Posts: 35
Jagadeeswara Yaramala wrote:I thought this is of some help...!!


Thanks,mate!!!
It's a lot more than I asked!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie - Best practice for a new .db ?
 
Similar Threads
wsad and oracle -SOS
database access
What's the best "Local RDBMS" ?
How to bind a JNDI entry declaratively
[Grails] Schema Export