static {
//System.loadLibrary("serial_port");
try {
if (File.Exists(File.getDirInternal(), "libserial_port.so") == true){
System.load(File.Combine(File.getDirInternal(), "libserial_port.so"));
}else{
Log.d(TAG,File.getDirInternal());
Log.d(TAG,"Not Found: File.getDirInternal() libserial_port.so");
//**************************************************************
try {
if (File.Exists(File.getDirAssets(), "libserial_port.so") == true){
Log.d(TAG,"Copy serial lib from File.getDirInternal()");
File.Copy(File.getDirAssets(), "libserial_port.so", File.getDirInternal(), "libserial_port.so");
System.load(File.Combine(File.getDirInternal(), "libserial_port.so"));
}else{
Log.d(TAG,File.getDirInternal());
Log.d(TAG,"Not Found: File.getDirAssets() libserial_port.so");
}
} catch (IOException e) {
e.printStackTrace();
}
//*********************************************
}
} catch (IOException e) {
e.printStackTrace();
}
}