If you're running into problems I would recommend the following steps.
1. Try the GrocerySync Applicaiton on a real device. This has the
most recent version of Couchbase Mobile installed. This is known to
work on several devices (though NOT in the emulator).
https://github.com/couchbaselabs/AndroidGrocerySync
2. Use the "adb logcat" command to capture the output when launching
the application.
3. Try and retrieve the CouchDB log file. For grocery sync this can
be found in /mnt/sdcard/Android/com.couchbase.grocerysync/db/couch.log
(the prefix for this path may be different on your device)
If GrocerySync is not working for you, it will help to report the
following information.
- OS
- Eclipse version (if using eclipse)
- Android SDK version
- Device Model and Android OS version
When sending logs, please use a service like pastebin and email the links.
Hopefully we can identify some common element between the users
running into this problem. In parallel we are working on a new build
which will produce more debug output from the CouchDB thread.
marty
However, I finally got around to trying the new ARMv7 support that can
be installed as part of the Android 4.0 (API 14). When I created an
AVD with Target set to API Level 14 and CPU/ABI set to armeabi-v7a I
am able to run GrocerySync.
There are a few caveats though:
- It is incredibly slow. The initial sync takes something like 10
minutes, this is partly because the emulator is slow and partly
because of the number of changes that have to be transferred from
server to client. You can mitigate this by changing the URL it syncs
with to something you have control over.
- Even after all the changes have transferred, the app will get a
socket timeout exception when accessing the view the first time (and
maybe the first few times depending on how many changes were present
when it crashed the first time) I only had to relaunch the app twice.
But eventually CouchDB had the whole view indexed and the view
returns almost immediately. The socket timeout issue is a bug in
GrocerySync that I'll work on shortly.
marty
I did not re-build Couchbase for Android 4.0, I used the existing
release without any problems.
Be sure to select the ARM EABI v7a System Image when updating your
Android installation.
Then create an AVD with Target set to API Level 14 and CPU/ABI set to
armeabi-v7a.
Then launch the application and be sure to select the AVD that supports ARMv7.
I cannot provide you a date when we will add support for ARMv6. We
understand there is demand for this capability and we fully intend to
address this need. There is an issue in JIRA tracking it here:
http://www.couchbase.org/issues/browse/CBMA-13
We are not ignoring the issue, rather we have been focussing on
stabilizing the API first. Adding support for ARMv6 is something that
should be a non-breaking change in the near future.
marty
I have been able to build a version of libmozjs that works on older
devices. There are a couple of issues with this build.
1. It was with a newer version of spidermonkey. So new it actually
introduces other problems we'd rather not solve right now. I'm pretty
sure the configure flags with some minor tweaks will work with the
existing spidermonkey, I just haven't had time to go back and try.
2. We need to update the build process to build 2 separate versions
of libmozjs now. The reason is that when supporting the older
instruction sets we have to disable support for JIT. We expect this
to be a performance hit that not everyone will want to take. So we
would like to be able to build an armv5te version with JIT disabled,
and an armv7 version with JIT enabled. This way the application
developer can choose the right size/space/device-support trade-offs
for their application, more on this in #3
3. We need to update the installer to offer some options:
Default: ARMv7 only version, will be fast and support most devices
Fat: ARMv7 and ARMv5te versions both installed (using right folder
structure Android will load appropriate lib) takes 2x space
Slow: ARMv5te only version, will generally be slower, but will be
compatible with more devices and take up less space
The configure options I used for nspr and spidermonkey are below (NOTE
they won't work out of the box on the older spidermonkey because that
is designed to work with an older NDK)
./configure \
--target=arm-linux-androideabi \
--with-android-ndk=$ANDROID_NDK_ROOT \
--with-android-toolchain=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
\
--enable-strip \
--with-arch=armv5te \
--with-thumb-interwork=no \
--with-thumb=no \
--disable-methodjit \
--disable-tracejit \
--with-soft-float
./configure \
--target=arm-linux-androideabi \
--with-android-ndk=$ANDROID_NDK_ROOT \
--with-android-toolchain=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
\
--with-android-sdk=$ANDROID_SDK_ROOT \
--disable-tests \
--disable-shared \
--enable-static \
--enable-strip \
--enable-endian=little \
--with-arm-kuser \
--enable-threadsafe \
--with-nspr-cflags=-I$(pwd)/../../nsprpub/dist/include/nspr \
--with-nspr-libs="-L$(pwd)/../../nsprpub/dist/lib -lnspr4 -lplc4 -lplds4" \
--with-arch=armv5te \
--with-thumb-interwork=no \
--with-thumb=no \
--disable-methodjit \
--disable-tracejit \
--with-soft-float
It's not a huge task, but if you haven't been building the Android
Couchbase project from source you may sink some time there. But
contributions are always welcome.
marty
Thanks again,
Milan
Some pieces are compiled directly using the NDK (ndk-build), other
pieces are compiled using a utility script (agcc) which is a wrapper
around the toolchain provided by the NDK, and then spidermonkey has
its own build scripts that directly use the toolchain from the NDK
(but the version of spidermonkey we're currently using depends on an
older version of the NDK).
To my knowledge, spidermonkey is the only component that is
specifically targeting armv7. And in our testing everything except
javascript views works on the older architectures.
marty