Search code examples
javakotlingradlebuild.gradle

Import class and dll files in Gradle project


I've just purchased an RFID Writer that comes with an SDK, the problem is the SDK isn't a .jar file, but these: enter image description here

How can I import these to my Gradle (Kotlin) project?

I'm using Intellij IDEA.


Solution

    1. Copy the dll files into your project folder
    2. Copy Reader09.java into your main folder (the .class file is not needed)
    3. Before the app starts, load the libraries:
        System.loadLibrary("Basic")
        System.loadLibrary("UHF_Reader09")
    

    Now you can call the methods from Reader09 class.

    Thanks to NitronHX for the guidance.