Pure Java DB implementation

Hi,

I would advise against a pure Java DB in mobile environments, when there are alternatives.

  1. Sqlite

    Sqlite is present on both Android and iOS. I think, we had a sample in the old days, where we used Sqlite on both Android and iOS with the same Java API. It looks like it is not in the samples repo, but it would make sense to offer a common Sqlite API for Android and iOS. The best option here would be to get the Android Sqlite API running on MOE, so the Android Database API would be available on iOS as well, thus you could use it in the common module.

  2. RealmDB

    You mentioned, that you already use Realm. The core of Realm is a C++ library on every platform. I already recommended it in an earlier topic about Realm: you just need to get their JNI bindings to compile on MOE (and it seems some minor Android -> MOE porting will be also required), and you can use the same Realm Java API on Android and iOS. No need to use Nat/J based bindings in this case. See my earlier answer in that topic: Using Realm on MOE

    Other members of the community used the Nat/J Generator to successfully generate Java bindings to the Objective-C API of Realm. It is a functional approach, but not what you need, because in this case you will have 2 Java APIs.

Best Regards,
Gergely