Native library not found exception for usb4java usage in android device - java

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.

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.

Related

How to develop an Android application without Android Studio?

I've installed and set up Java JDK 17 as well as Android SDK (the manual way) on my Ubuntu 22.04.
From there, is it possible to develop an Android application in Java WITHOUT Android Studio ?
Developing through the command line or through a light IDE is fine by me, but there are very few guidance and information out there.
Thanks to enlighten me.
Sure you can! You'll need to type an awful lot of stuff though, that Android Studio does for you automatically:
You'll need to create gradle files to build your project, you'll need to create an Android manifest to describe your Android components and your app (permissions, themes, target SDK, etc.).
You'll need to create the code files containing your Android components (Activity, Fragment, Service, BroadcastReceiver, etc.). You'll need to create all your UI definition files in XML (layouts and other resources).
Then you can use gradle on the command line to run all the necessary preprocessors, code generators, compilers, linkers, resource builders and package builders to give you an APK which you can then install on your device for testing. And you can debug by writing lots of stuff to the logs and using adb commands to get the logcat off the device to see the log messages, exceptions and stack traces.

Does the java version make any difference when building a Flutter app?

I am wandering if building a Flutter app with different java versions make any difference. Could the version influence if the app crashes or not in an old device, for example?
Generally, It won't effect anything. However, if you're using some plugin/package that require specific java version, it might cause a problem. If your app crashes, read the log and see if it is caused by a package/plugin and if so, that particular package might need a specific version.

How to make a shared library in Android?

I'm working on a Android embed system, and have a make a service library for all app installed in the system.
This library is shared, I mean it doesn't packed in the other apk, it's a standalone apk and when install it, other app can use library.
You can imagine like openCV app example from version 2.4. User have to install OpenCV Manager and other app have to import it, otherwise it will throw Exception and require you to install this app. It also have same behaviour like <uses-library> tag in manifest but no instruction how to do it.
Sơ anyway to solve it?
PS: I have search everywhere but all the post is about static lib use Android Studio. Shared Library found only use Eclipse and for a long time ago. At new version, openCV sample is converted to Android Studio and use normal import.

The Bluestacks Android emulator is built using .Net?

I recently installed the Bluestacks Android emulator. I happened to look at the process running under ProcessExplorer and was surprised to see that it is a .NET application.
The HD-Frontend.exe is the Bluestacks UI process and is highlighted yellow because it has loaded the .NET framework. There are a number of other processes associated with Bluestacks and most are also .NET.
Opening the EXE in Reflector.NET also shows that it is .NET.
I thought Android was Java-based. What's going on here?
Android is Java-based, but that does not mean an Android emulator has to be written in Java -- just functionally emulate Android devices.
While BlueStack's site does not list any system requirements for its emulator that I could find, at least a couple sites -- e.g. Bazooka Apps and Android Emulator for PC -- mention .NET as a requirement.
Ultimately the proof of what's going on is right in the process list and Reflector results you found.
its an emulation tool whose job is to read the dex code respond to that how the android phone should respond and not to compile and run that dex so it could be on python or ruby also there is no boundation at all that you have to make android emulator on java becuase android is built upon java.

Making apk from jar using microemulator

Well i `ve made an app using java me and as graphics i used lwuit library which i added into the midlet`s jar. On Nokia it runs smooth and i wanted to port it to android. So i found out about microemulator http://microemu.blogspot.ro/2008/11/running-java-me-applications-on-android.html and i followed those steps and i got the apk. However when i run it into the Android Emulator it closes at start. I don`t know what may be the problem because i was able to convert the demo jar app into apk and it ran succesfuly.
Any ideas on what should i do?
I suggest you port your application to Codename One which should be pretty simple. It has proper Android support which will make your application look and act native on Android.

Categories