Closed AhmedHumk closed 1 year ago
Hello!
Make sure you added kotlin-stdlib as a dependency to the module where you plan to use the library. kotlin-stdlib is a small library that has great backward and forward compatibility, so it won't cause troubles for your java application.
dependencies {
// Add this line!!!
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.31"
implementation "com.github.fingerprintjs:fingerprint-android:1.2"
}
After you did it – Android Studio will suggest you corresponding imports.
Thank you for replay but i still cant figure what is function1
Function1 is an analog for lambda function for Java 6.
Kotlin initially was supporting lambdas while Java 6 does not. Due to have interoperability with Java 6 this class appeared. If Java in your project has version which supports lambdas, Android Studio will suggest you simplify this to:
fingerprinter.getFingerprint(fingerprintResult -> {
String fingerprint = fingerprintResult.getFingerprint();
return null;
});
fingerprinter.getDeviceId(deviceIdResult -> {
String deviceId = deviceIdResult.getDeviceId();
return null;
});
i tried to follow the documentation
but what is function1 and unit ? unit refer to kotlin unit and i try to test in java