Simple guide to help integrate Minter's SDK within pure Java/Kotlin project
-
Download required SDK from official bintray repository: https://bintray.com/minterteam/android
-
There are 4 files:
- *-javadoc.jar
- *-sources.jar
- *.aar
- *.pom
You need *.aar one.
-
AAR archive is an Android Archive. It's just a zip file, you can unzip it using
unzip
:unzip minter-android-core.aar
, or just renameaar
file tozip
and do it with preferred tool. -
After extraction, there will be stored some files. You need only classes.jar. Rename this file to library name. Example: we was download minter-android-core library, unpacked minter-android-core-0.4.0.zip; find in unpacked drectory classes.jar and rename it ito minter-android-core-0.4.0.jar
-
Important thing: if you're want to sign transactions with minter-android-blockchain SDK, you MUST build or just download native JNI libraries for your system:
-
Next: as android have some own classes, you should add it to your project as mocks (dummy classes with required names): link
-
Last important thing: to use native JNI libraries, java MUST know where are they located. You can try one of variants:
- add JVM flag
-Djava.library.path=/path/to/native_libs
; - store libraries into system's library directory:
- Linux: /usr/local/lib or /usr/lib
- Darwin: /usr/local/lib
- Windows: %windir%\System32 (??? - not sure)
- try to add lib files directly to project dir (could work on windows, but not guaranteed)
- add JVM flag
-
Example projects for pure java:
- UnsatisfiedLinkageException - Java can't find native libraries