Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Android devices support jni?

I have developed an Android application which uses JNI (java native interface) for Archos 43.

Had no problems and i was able to run the application smoothly. Later I tried to run the same application on Samsung I9100G Galaxy S II as well as Samsung I9100 Galaxy S II.

I was able to run the application on I9100G but not on I9100.

The reason being that the JNI part of the application was not supported on I9100.

I did try to get to know the reason for this and was able to find that I9100G uses Ti OMAP 4430 chipset and PowerVR SGX540 as GPU whereas I9100 uses Exynos 4210 chipset and Mali-400MP as GPU.

I suspect that the reason might be the change in chipset (since Archos 43 uses Ti OMAP as well). But any further results couldn't be obtained from my search.

update The application makes use of bluetooth. While trying to connect to a custom hardware(CH), am not able to get any response from the CH when am running the application on I9100. The bluetooth communication part is written using jni.

So my question is whether am not able to run my application with JNI on I9100 because of the chipset and if so why ?

Also a more general question is which devices support Android JNI applications and what are the basic features necessary in a device to run an Android JNI application ? (I spent a considerable amount of my time trying to find the answers for all these questions and any help will be greatly appreciated.)

Thank You.

like image 940
user1721904 Avatar asked Oct 05 '12 04:10

user1721904


People also ask

What is the JNI in Android?

JNI is the Java Native Interface. It defines a way for the bytecode that Android compiles from managed code (written in the Java or Kotlin programming languages) to interact with native code (written in C/C++).

What is NDK and JNI?

JNI is just the way that Java handles calling into native/C++ code, and calling back into Java from there. It has nothing to say about Android - it is a Java language feature. The Android NDK is a way to write Android applications using code called by JNI.


2 Answers

All Android devices 'support' JNI, that is how a big part of the OS is implemented: Java services and frameworks using native libraries via JNI. There are, however, different architectures, and if you have a native module, you need to make sure you build one for each architecture you want to support. Even if you are targeting ARM devices only, there are ARMv5 and ARMv7 ones out there. ARMv5 should work on all, but is slower.

Galaxy SII devices probably use the same architecture, so you've hit some other problem/bug. What errors did you get? Post logcat if available. Maybe you are trying to access hardware that is not available on one of the devices? Or link against system libraries that are for some reason missing?

like image 163
Nikolay Elenkov Avatar answered Oct 16 '22 22:10

Nikolay Elenkov


Now that you disclosed that the problem might be related to BT on 2.3.3, it all makes sense. The Android Bluetooth interface before 4.0 was not standartized, and it's most likely that your code is TI OMAP - specific. So, if you want to support other chipsets, you need to communicate to other drivers, or target devices with ICS and higher.

like image 24
Alex Cohn Avatar answered Oct 16 '22 22:10

Alex Cohn