Reputation: 169
Hi all can anyone say why I should use an SQLite database for my mobile application? Are there any databases instead that I can use?
Upvotes: 6
Views: 9002
Reputation: 59
You can also use the DB4O database. For more help you can check out their website. http://www.db4o.com/(S(tqvrulmp3ybmtw55i3mgop55))/Android/default.aspx
Upvotes: 0
Reputation: 7696
SQLite database is the way to go :-)
smashing magazine posted a nice article about it last week
http://www.smashingmagazine.com/2011/03/28/get-started-developing-for-android-with-eclipse-reloaded/
Upvotes: 3
Reputation: 21
As mentioned in another answer, you can cross-compile Berkeley DB for Android and use the Java Bindings, including it as an .so native library within your .apk (comes out packed at ~710k). There is a step-by-step guide here (since it requires minor tweaking).
Upvotes: 0
Reputation: 1980
Another option is Berkeley DB, which like SQLite is a lightweight, fast, reliable database library. You have a few different options of how you can use Berkeley DB on Android:
Disclaimer: I'm the Product Manager for Berkeley DB. That said, we think that SQLite is a great product (we're part of the SQLite Consortium) and we're happy to see people adopting and using it. There are situations where Berkeley DB may be a better choice, hence my suggestion here.
Upvotes: 2
Reputation: 2497
It's generally accepted that SQLite is the best database platform for Android because it's light weight nature lends itself nicely to mobile devices where processing power and memory are limited.
That's not to say that you couldn't do it, at the end of the day it's Java. You could write your own, or find open source code, that would enable you to use another database. The problem there is that the phone would also have to have a database daemon to handle the requests whereas in SQLite the database is a file stored on the phone and so can easily be accessed in Java.
At the end of the day it would be silly to try and run a MySQL daemon for example on a phone because I very much doubt it'd have the memory to cope. You'd be much better of getting used to SQLite because it's a very flexible and popular database platform.
Upvotes: 0