-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Incompatible minimal SDK version set by default #4955
Comments
We just removed the dependency on libhidapi.so, can you check and see if this is resolved in the latest snapshot? |
I upgraded our project to the linked version, did did progress further but then failed to locate libbzip2 which we depend on. A bit odd since it should have been part of Android since 1.6. Considering that even 4.3 only makes up 1 out of 9600 users. It's hard to justify the effort in getting things working for an even older version :) The android-project in SDL doesn't build out of the box, so haven't tested a bare bones app. I can maybe look in to that later. |
My builds that include HIDAPI have been running on 4.1 no problem for a while now. I'd rather we didn't raise the minimum to 18. It doesn't need to be. |
I just updated the SDL android project so it builds out of the box in 7ad6435. I ran the following and verified that the simple test program works on Android 12: |
I'm going to close this issue since hidapi is no longer used. Please open new issues for any problems with older or newer SDKs and devices. Thanks! |
Cool will upstream all our other fixes then :) |
@AJenbo how are you getting on now with the latest source with android versions under 4.3? I'm testing on a physical 4.2.2 device and apps run ok but I'm getting a big mess when it comes to game controllers. Would this be because HIDAPI requires 4.3+? Controllers often not being recognised when plugged in. When they're eventually picked up they're having a duplicate joystick-only version "Sony Computer Entertainment Wireless Controller" for PS4 controllers and "Microsoft X-Box 360 pad" for Xbox. Unplugging doesn't produce remove events. Rumble doesn't stop. Bluetooth connected controllers don't produce any events. Other Android versions work as expected, sort of. |
I guess disabling HIDAPI with a hint if SDK is < 18 is a workable solution? Sorry, I'm still learning and understanding about this. |
Yes, this seems like a good solution. Are you guys able to test this? |
Already did and it seemed to have the desired effect. Obviously losing all the features HIDAPI offers, along with the bugs and crashes that happen on SDK < 18. |
Is it possible to set this hint in the manifest file using similar version-conditional syntax recently added to WRITE_EXTERNAL_STORAGE? |
Can you submit a pull request for this? I don't have a way to test it, and I'd like to make sure we're putting tested changes in for 2.0.18. thanks! |
I've no idea how to do a pull request, really sorry. I'm not sure what one even is embarrassed. I am a complete Github virgin. All I can say is that I put this code into
|
Ah, gotcha, thanks for clarifying. This isn't something you can put in the manifest conditionally based on API version, as far as I know. |
It's a change proposal. It is done by first forking the repository to you own account. Making your changes do it. Then go to the repositories Pull Request (PR) tab and press create new. I believe on GitHub it's also possible to do all of this via the browser simply by editing the file. |
Thanks @AJenbo . But I'm lost at the forking and account bit. My account isn't linked to SDL. I download a .zip of the source code, compile the DLL with Visual Studio 2019 and copy the src to where my Android Studio project can pick it up. I started programming in the early 1980s and still do everything the old school way. If it's possible to edit the code from the browser, then I can do it that way. The other problem is that I'm not confident I would be following the strict formatting rules. And that I might break something else. In this instance I would try to put the above bit of code in the place where SDL checks the |
That isn't relevant. When you fork you make your own copy where you are free to do what ever you want. A PR is a suggestion to the SDL project that they should apply some of the changes you have made in your copy. You create a fork (copy) by clicking
Don't worry. There are 14 test suites run automatically on incoming PRs and a human has to also approve it. To edit a file in the browser simply navigate to it and press the pencil in the upper right corner of the file. This works best if you only need to suggest changes to a single file. |
Confirmed |
Since HIDAPI was required in SDL 2.0.9 (d2042e1) it has not been possible to run on Android older then 4.3 (SDK 18), but the minimum SDK still indicates 16 (Android 4.1).
Because of this discrepancy installations on Android 4.1-4.2 are allowed by launching the app will result in the following error being presented to the user:
I'm not sure how possible it is to make all the HIDAPI code conditional on the system SDK version. But considering how old Android 4.2 is at this point (2012). Support for the OS having ended about 5 years ago, and play services having been discontinued for it (and 4.3). And the user base being less then 1% of Android installation. I suggest simply bumping the minimal required SDK to 18 (Android 4.3) to resolve the issue.
SDL/android-project/app/build.gradle
Line 16 in 3eb9bfa
The text was updated successfully, but these errors were encountered: