authenteq-zz / java-bigchaindb-driver

Official BigchainDB Java driver
https://www.bigchaindb.com
Apache License 2.0
32 stars 22 forks source link

If there is a way to use this driver for Android? #37

Open fangvv opened 6 years ago

fangvv commented 6 years ago

I don't know if it is OK to use it for Android. If not, how could I do to let an Android APP to use BigchainDB as its DB. Thanks.

alvin-reyes commented 6 years ago

Not at the moment. We're trying to make it fully compatible with Android

adonnini commented 6 years ago

Hi, I have an Android app which i want to integrate with datum. I need to have a BigchainDB Java driver (although I guess I could try and make things work with the JS driver). Could you give me an idea of when the Bigchain Java driver will be compatible with Android? Thanks, Alex Donnini

bohdanbezp commented 6 years ago

Hey, I'm an Android developer myself and we are using the driver as a part of Android app. Basically you need to provide your version of JSONObject which is self-sorted by key. Tell me if you need more details.

adonnini commented 6 years ago

Hi,

Thanks very much for the feedback. Very helpful.

I have one request for help.

I am pretty familiar with Android and Java, not so much with JSON.

Could you give me an example of what you mean by "JSONObject self sorted by key"?

By the way, the Android app I will be integrating with BigchainDB is in the area of location tracking and mobility profiles. What kind of app are you integrating with BigchainDB?

Thanks,

Alex

Bohdan Bezpartochnyi wrote:

Hey, I'm an Android developer myself and we are using the driver as a part of Android app. Basically you need to provide your version of JSONObject which is self-sorted by key. Tell me if you need more details.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/authenteq/java-bigchaindb-driver/issues/37#issuecomment-350491534, or mute the thread https://github.com/notifications/unsubscribe-auth/AbhsoUcJPkVK-1bGFLSDgDvnqiAdtCV_ks5s-sHogaJpZM4Qnnmn.

adonnini commented 6 years ago

Hi Bohdan,

I would be grateful if you could send me an example of what you mean by "your own version of JSONObject". Any further details would be greatly appreciated.

Thanks,

Alex Donnini

Bohdan Bezpartochnyi wrote:

Hey, I'm an Android developer myself and we are using the driver as a part of Android app. Basically you need to provide your version of JSONObject which is self-sorted by key. Tell me if you need more details.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/authenteq/java-bigchaindb-driver/issues/37#issuecomment-350491534, or mute the thread https://github.com/notifications/unsubscribe-auth/AbhsoUcJPkVK-1bGFLSDgDvnqiAdtCV_ks5s-sHogaJpZM4Qnnmn.

bohdanbezp commented 6 years ago

@adonnini Sorry for the late reply. In order for the code to work on Android you need:

  1. Download official org.json implementation source code
  2. in the JSONObject constructor replace map field initialization with this.map = new TreeMap<String, Object>();
  3. Rename the package name of the modified org.json distribution for example to org.jsonorder.
  4. Add the package to driver's build and replace all occurences of org.json.JSONObject in the driver to org.jsonorder.JSONObject
  5. Build the driver

This is a dirty way but right now there's no other way around without too much effort,