3

I intend to write an app for Windows Phone 7, then port it to Android. Database usage is for persisting a small amount of user-generated data.

I am considering cross-platform databases because I'd prefer the code-bases to be similar, ideally the presentation-layer code would have the biggest differences.

The only cross-platform mobile database I've found so far is db4o, but deployment to the WP7 emulator is a non-starter, plus their documentation emphasized that their Silverlight/WP7 support is still a "work in progress". I'd rather get on with making my app than waiting for their house to get in order.

I may resort to using an XML file, but before I do has anyone else spotted .Net/Java mobile databases out in the wild that are worth a look?

3 Answers 3

3

What's wrong with SQLite?

Android supports it out of the box, and even though I'm not familiar with WP7 I think it is well supported.

Unless you are looking for a cross-platform ORM.

2
  • 1
    I agree with your overall recommendation, but SQLite is NOT well supported on WP7 Jun 29, 2011 at 18:29
  • After looking at some SQLite example code, I remembered the part I hate the most is dealing with CRUD! So, yeah, cross-platform ORM is the best, yet I haven't found anything that is as good as .Net's EF code-first, although db4o (for my purposes) would have been an excellent replacement (had it been "ready for prime-time")!
    – Rocjoe
    Jun 29, 2011 at 18:44
2

We have an app that is on Android, iOS, and WP7 that all use the same SQLite database. Using a SQLite database is really easy and straight forward in Android and iOS. It is NOT supported out of the box on WP7 but there are a number of guides to getting it working out there. I wrote my own guide using the Community C# SQLite Project which you can find here: http://www.wirebear.com/blog/2010/11/12/using-sqlite-in-your-wp7-app/ but there are several other options that you should be able to find relatively easily.

However, not really knowing what exactly you are trying to save, a database could be overkill. If it is relatively simple data and/or pretty small, XML or JSON are both fine options that can be stored, retrieved and parsed easily on all three platforms.

1
  • SQLite seems to be my best option, do you use ORM, or are you writing the SQL yourself?
    – Rocjoe
    Jun 29, 2011 at 18:47
0

I suggest SQLite or your own xml implementation. I'm sure there's a library for almost every os out there for managing xml databases. Plus you won't resort on privative or complex open source databases. Remember KISS.

2
  • The possibility of an XML-database library sounds encouraging, but I haven't found anything suitable so far. Still looking though.
    – Rocjoe
    Jun 29, 2011 at 18:48
  • Don't search as xml database, just for an xml library to parse and read from xml files. If you want sql like queries, that's another story. But if there's less than a thousand or so entries, a simple search with dynamic memory techniques would suffice.
    – AlfredoVR
    Jun 29, 2011 at 20:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.