Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Minter SDK in pure Java

How to use Minter Android SDK within pure Java/Kotlin project

  1. Download required SDK from official bintray repository:

  2. There are 4 files:

    • *-javadoc.jar
    • *-sources.jar
    • *.aar
    • *.pom

    You need *.aar one.

  3. 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 rename aar file to zip and do it with preferred tool.

  4. 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; find in unpacked drectory classes.jar and rename it ito minter-android-core-0.4.0.jar

  5. 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:

  6. Next: as android have some own classes, you should add it to your project as mocks (dummy classes with required names):

  7. Last important thing: to use native JNI libraries, java MUST know where they are located. You can try one of this option:

    • add JVM flag -Djava.library.path=/path/to/native_libs;
    • store libraries to the 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)
  8. Example projects for pure java:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment