Add secondary lib search path for Android

This commit is contained in:
hedgecrw85 2018-10-12 16:58:08 -05:00
parent 68e102cca3
commit 522cd5525c
1 changed files with 6 additions and 1 deletions

View File

@ -2,7 +2,7 @@
* SerialPort.java * SerialPort.java
* *
* Created on: Feb 25, 2012 * Created on: Feb 25, 2012
* Last Updated on: Oct 08, 2018 * Last Updated on: Oct 12, 2018
* Author: Will Hedgecock * Author: Will Hedgecock
* *
* Copyright (C) 2012-2018 Fazecast, Inc. * Copyright (C) 2012-2018 Fazecast, Inc.
@ -205,6 +205,11 @@ public final class SerialPort
{ {
// Load the native jSerialComm library // Load the native jSerialComm library
InputStream fileContents = SerialPort.class.getResourceAsStream("/" + libraryPath + "/" + fileName); InputStream fileContents = SerialPort.class.getResourceAsStream("/" + libraryPath + "/" + fileName);
if ((fileContents == null) && isAndroid)
{
libraryPath = libraryPath.replace("Android/", "lib/");
fileContents = SerialPort.class.getResourceAsStream("/" + libraryPath + "/" + fileName);
}
if (fileContents == null) if (fileContents == null)
{ {
System.err.println("Could not locate or access the native jSerialComm shared library."); System.err.println("Could not locate or access the native jSerialComm shared library.");