question

florom-cisum avatar image
florom-cisum asked

JNI - fat binary with armeabi and armeabi-v7a - Kindle HD selects wrong lib

My app originally built for any Android device uses JNI (Java Native Interface). It worked right away on my new Kindle HD 7 inch device, great! I've built the JNI libraries in three flavours - arrmeabi, armeabi-v7a and x86. However it was running very slow and I found out that on Kindle the arrmeabi version is used event though it should use the armeabi-v7a version. Not building arrmeabi (and x86) it runs as fast as expected using the armeabi-v7a library. Doesn't Kindle support "fat binaries" meaning that the app contains multiple version of a JNI library and loads the most appropriate? If it does support that, what am I missing? On regular Android devices such Google Nexus 4 and 10 this works as expected (armeabi-v7a is loaded on the devices that supports it). Thanks
fire tablet
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Florom, Thank you for writing to us. I have forwarded your query to the concerned team and waiting their reply. I will post back shortly.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

florom-cisum avatar image
florom-cisum answered
I Googled for the problem and found out it's a bug in Android 4.0.x (Ice Cream Sandwich) meaning it's not a problem with Amazon Kindle. My Kindle Fire HD7 runs Android 4.0.3 but my other Android devices runs 4.2 or 4.3, that's why I didn't encountered the problem until now. Here is a one description of the same problem: http://grokbase.com/t/gg/android-ndk/122k4fjbt2/problem-with-armeabi-v7a-library-on-ics Here is a one workaround for the problem: http://www.moodstocks.com/2012/03/20/ice-cream-sandwich-why-native-code-support-sucks/ So problem solved.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Florom, This is a problem with core Android that our Gen5 devices are based on. http://code.google.com/p/android/issues/detail?id=25321 It is repaired in later versions of Ice Cream Sandwich, and by extension Jelly Bean. Enclosed is a link to the specific platform level fix: https://android.googlesource.com/platform/frameworks/base/+/10410fc85248ea77c2c1fbbb666c3fe4fcfef1b6
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.