How to import JNI to a project: Difference between revisions
No edit summary |
|||
Line 3: | Line 3: | ||
=== import so file === | === import so file === | ||
From latest APIDemo, you can find the neweast so files of all the devices in the POS. Then select the so file you want to import to your project, put the so file to the path '''lib/armeabi'''(for a special POS, the WizarPAD, the path is '''lib/mips''') . | From latest APIDemo, you can find the neweast so files of all the devices in the POS. Then select the so file you want to import to your project, put the so file to the path '''lib/armeabi'''(for a special POS, the WizarPAD, the path is '''lib/mips''') . | ||
The so files in APIDemo is like: | The so files in APIDemo is like: | ||
[[File:so files.png|frameless|left|thumb|caption]] | |||
=== 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. | 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 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. | |||
[[File:jniinterface.png|frameless|left|thumb|caption]] |
Revision as of 06:50, 20 April 2018
How to import JNI
There are two steps, to use the JNIInterface, one is to import the so file, the other is to import the corresponding JNIInteface.
import so file
From latest APIDemo, you can find the neweast so files of all the devices in the POS. Then select the so file you want to import to your project, put the so file to the path lib/armeabi(for a special POS, the WizarPAD, the path is lib/mips) .
The so files in APIDemo is like:
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 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.