when tested the app on galaxy 2 with android api 16 i get the following popup error
Error: Cannot load library:
link_image[1892]: 1853 could
not load needed library
‘libhidapi.so’ for ‘libSDL2.so’
(load_binary[1094]: Library
‘libhidapi.so’ no found)
on newer devices it works
the ibhidapi.so is in the apk
the build gradle in the android project state that min api is 14 so it should work?
Can you guys chip-in with your latest experiences with this? I’m having the same problem on Android 4.2.2 (which is what Galaxy 2 runs if not updated?). This started when the new hidapi was introduced in SDL 2.0.9.
@lxnt can you tell what you disabled in SDLActivity.java?
This is mostly due to android docs being horrible on how to make a gradle project without Android Studio (which is total shit in the face of even moderately sized C++ project) which would include multiple native dependencies (like SDL2, SDL2_mixer, SDL2_image and SDL_gfx with SDL2 patch) and put those dependencies’ libs and stuff where they belong.
And also SDL java glue throwing useless exceptions when hidapi can’t be loaded. That is a bug in SDL as far as I’m concerned.
Unfortunately that didn’t work for me. Still getting the error - but I might have made a mistake.
I’ve noticed a larger problem anyway. If you look at the new HID java files, they contain code that was introduced in API level 18. SDL2’s minimum API level is set to 16. Android 4.2.2 is API 17, so the hidapi stuff wasn’t going to ever work on Android 4.2 or below.
This looks to be fixed in 2.0.10. So if you can set up a working build with the new version this won’t be a problem.
If you use SDL_image, or _net or _ttf, you need to load them in getLibraries(). You can fudge SDLActivity.java directly, or the proper way is to override it in your own code. Just edit SDLActivity.java for now until you work out a better way. This is where you’d insert “hidapi”, but it’s already fixed now.