How to import JNI to a project: Difference between revisions

From wizarPOS
Line 7: Line 7:


=== Import JNI Interface file ===
=== Import JNI Interface file ===
From the APIDemo, you can find the JNI interface generated by us, the package name of the JNI interface is defined in the so file, since you can not change the so file, so when copy the JNI interface, please notice that you can not change the package name of the JNI interface.
The JNI interfaces we generated can be found in API Demo. Please note that their package name is defined in so file and cannot be modified. When copying JNI interface, please do not change the package name of JNI interface. For example, "com.cloudpos.jniinterface" is the package name, please do not change it in the project.


The JNI Interface class in APIDemo is like the follow picture, "com.cloudpos.jniinterface" is the package name, please don't change that name in your project.
The JNI interface classes in API Demo are as follows:
[[File:jniinterface.png|frameless|left|thumb|caption]]
[[File:jniinterface.png|frameless|left|thumb|caption]]

Revision as of 12:10, 14 March 2020

How to import JNI

There are two steps to use JNI interfaces, one is to import so file, the other is to import JNI interface file.

Import so file

You can compile the latest so files of POS devices from the latest API Demo, then select the so files to import into the project, and put them in the path of lib/armeabi and lib/armeabi-v7a (for special POS such as wizarpad, the path is lib/mips). The so files in API Demo are as follows:

caption

Import JNI Interface file

The JNI interfaces we generated can be found in API Demo. Please note that their package name is defined in so file and cannot be modified. When copying JNI interface, please do not change the package name of JNI interface. For example, "com.cloudpos.jniinterface" is the package name, please do not change it in the project.

The JNI interface classes in API Demo are as follows:

caption