0

I want to develop usb application with usb4java for Android device. I'm using Android Studio as an IDE and Ubuntu 14.04 as an operating system. I have added usb4java-1.2.0 file to my project. I can use Libusb function in my application. Firstly I wrote LibUsb.init() function in my MainActivity but there is an error about native library. I'm getting classloader exception.

Caused by: org.usb4java.LoaderException: Native library not found in classpath: /org/usb4java/linux-armv7l/libusb4java.so

I have analyzed Unsupported Platform tag in http://usb4java.org/nativelibs.html website. But I couldn't solve my problem with this way. After that I read https://github.com/usb4java/libusb4java and again I couldn't solve my problem with this way. Can you help me please.

bzkrtmurat
  • 189
  • 1
  • 3
  • 15

1 Answers1

0

The problem you're seeing is that LibUsb is trying to find the .so file, rather using the android load library calls. So you'll need to edit that. After that it may or may not work. But it would probably be smarter to use the USB functionality built into Android rather than a lower level library trying to use the Linux OS underneath it- it might not work at all, or may have unusual bugs due to interacting with Android.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127