/**
* Initializes the Fingerprint.
* Make sure to have the .so file in your assets folder!
* The .so file will be copied to the internal folder if it's not there.
* @throws IOException
*/
public void Initialize(final BA ba) throws IOException {
this.ba = ba;
//Copies the file to the internal folder.
if (!File.Exists(File.getDirInternal(), "libserial_port.so")) {
File.Copy(File.getDirAssets(), "libserial_port.so", File.getDirInternal(), "libserial_port.so");
Log.i(TAG, "Library copied to Internal Folder.");
}
//Load the library
try {
System.load(File.Combine(File.getDirInternal(), "libserial_port.so"));
Log.i(TAG, "Library loaded!");
} catch (Exception e) {
Log.i(TAG, "Cannot load library: " + e.getMessage());
}
//Initialize the library
setObject(new fingerprint_native());
}