couchbase lite java API for ios and android

25 views
Skip to first unread message

aravinda.t...@gmail.com

unread,
Apr 20, 2018, 6:01:17 AM4/20/18
to CodenameOne Discussions
Hi,

How to use couchbase lite core API in ios and android using codenameone. Is there any documentation on it?
The couchbaselite page says it is supported for android?

Thanks and Regards
Aravinda T

Shai Almog

unread,
Apr 21, 2018, 12:32:33 AM4/21/18
to CodenameOne Discussions
Hi,
we don't have builtin support for that. Someone would need to port the database to work with Codename One which isn't hard but is a bit of work.

The only reasonable way to do this is with native interfaces https://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html

The Android version of the Database contains some Java code but a lot of non-Java code so it's not something that can be realistically ported to iOS etc.

If we have enough demand from enterprise customers we can probably wrap couchbase in a cn1lib.

aravinda.t...@gmail.com

unread,
Apr 21, 2018, 9:57:57 AM4/21/18
to CodenameOne Discussions
Hi,

Thanks for the quick response. We will try this option of using couchbase lite in our app. Do you fore see any performance issue with this approach? In this approach there will be different code for ios and android interfaces calling native? Is my understanding is right? Is it possible to pass json object as parameter to native? 

Thanks and Regards
Aravinda T

Shai Almog

unread,
Apr 22, 2018, 12:22:33 AM4/22/18
to CodenameOne Discussions
Hi,
this is native so it will perform exactly as native code does.
Yes the database would have a different implementation for iOS & for Android.

Native interfaces don't allow passing arbitrary objects since the native iOS VM (and a few of the other VM's) would be hard to use with objects. You can pass a JSON string into the native interface. Since the iOS native API won't be able to use a Java level JSON object anyway that makes sense. You will get a NSString (which is the native iOS String type) in the iOS side and you can work with that.
Reply all
Reply to author
Forward
0 new messages