How to import JNI to a project: Difference between revisions

From wizarPOS
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== How to import JNI ==
=== Import .so File ===
There are two steps to use the JNIInterface, one is to [[#Import so file|import the so file]], the other is to [[#Import JNI Interface file|import the corresponding JNI Inteface]].
* '''Compilation''': First, compile the latest .so files from the latest API Demo for POS devices.
=== Import so file ===
* '''Selection and Placement''':
From latest APIDemo, you can compile 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''', and '''lib/armeabi-v7a'''(for a special POS, the WizarPAD, the path is '''lib/mips'''),  .
** For standard devices, import and place these files in the '''lib/armeabi''' and '''lib/armeabi-v7a''' directories.
 
** For specific models like WizarPad, place them in the '''lib/mips''' directory.
The so files in APIDemo is like:
* '''API Demo Reference''': The API Demo includes the following .so files:
[[File:so files.png|frameless|left|thumb|caption]]
[[File:so files.png|frameless|left|thumb|caption]]


Line 31: Line 31:




=== Import JNI Interface File ===


The JNI interfaces generated for smart POS applications can be found in the API Demo. It's important to note a few key guidelines:


* '''Package Name Consistency''': The package name for the JNI interfaces is predefined in the .so file.
** '''Important''': Do not modify the package name when copying the JNI interface.
** '''Example''': If the package name is "com.cloudpos.jniinterface," ensure it remains unchanged in your project.


 
* '''List of JNI Interface Classes''': The API Demo includes the following JNI interface classes:
=== Import JNI Interface file ===
A visual representation of the JNI interface classes can be helpful. The below image shows the JNI interface classes as found in the API Demo.''
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]]
[[File:jniinterface.png|frameless|left|thumb|caption]]

Latest revision as of 08:11, 10 January 2024

Import .so File

  • Compilation: First, compile the latest .so files from the latest API Demo for POS devices.
  • Selection and Placement:
    • For standard devices, import and place these files in the lib/armeabi and lib/armeabi-v7a directories.
    • For specific models like WizarPad, place them in the lib/mips directory.
  • API Demo Reference: The API Demo includes the following .so files:
caption













Import JNI Interface File

The JNI interfaces generated for smart POS applications can be found in the API Demo. It's important to note a few key guidelines:

  • Package Name Consistency: The package name for the JNI interfaces is predefined in the .so file.
    • Important: Do not modify the package name when copying the JNI interface.
    • Example: If the package name is "com.cloudpos.jniinterface," ensure it remains unchanged in your project.
  • List of JNI Interface Classes: The API Demo includes the following JNI interface classes:

A visual representation of the JNI interface classes can be helpful. The below image shows the JNI interface classes as found in the API Demo.

caption