8

For some reason I want to avoid Android's official SQLite implementation.

There seem to be very few alternative, and they seem to be very new, not-tested-much libraries with few operations implemented.

I hope to not be too subjective, but here are the features I need:

  • SQLite format
  • Has SELECT, INSERT, UPDATE, DELETE
  • Basic WHERE, with indexes
  • Indexes are updated (I am not asking for new index creation)
  • Open Source

Note: I recently ported SQLJet to Android, and I just saw the website of SQLdroid (not sure what it does). I am surprised I can't find any fork of Android's SQLite, that could be acceptable as well.

Community
  • 1
  • 1
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373

3 Answers3

1

You can try OrmLite. I think it is convenient for you: lightweight, SQLite support with basic CRUD functionality. And it is easy to learn.

You can fork it from Git

Object Relational Mapping Lite (ORM Lite) provides some lightweight functionality for persisting Java objects to SQL databases while avoiding the complexity and overhead of more standard ORM packages. It supports a number of SQL databases using JDBC and also supports Sqlite with native calls to Android OS database APIs

haotang
  • 5,520
  • 35
  • 46
1

Have you checked the BerkeleyDB? (nice paper here)

Or H2?

Community
  • 1
  • 1
Regex Rookie
  • 10,432
  • 15
  • 54
  • 88
  • My app is for *.anki files, which are actually SQLite databases. That's the standard file format for several applications on PC/Mac/Linux/ios/Android, I can't change it. – Nicolas Raoul Oct 14 '11 at 15:49
  • @Nicolas Raoul Sorry, I didn't realize the file format compatibility is a requirement. – Regex Rookie Oct 14 '11 at 18:42
1

I've been using SQLiteJDBC in a desktop Java app for a couple of years now, with good results. I'm not sure how hard it would be to port to Android, but it includes a pure-java driver generated from the original SQLite sources (It uses NestedVM which compiles everything to a MIPS instruction set, then generates a virtual machine in Java to execute the code - slow, but it works). Otherwise it also has native compiled binaries for several (desktop) platforms.

If you're not concerned about speed, or the size of your .apk (the .jar with just the NestedVM code is about 1.1MB), it might work for you.

Kothar
  • 6,579
  • 3
  • 33
  • 42