|
ae8ca7c5
|
2016-10-17T22:09:22
|
|
Fixed bug 3444 - Android-TV: no more handling of back button on remote
ny00
Unfortunately, simply checking the return codes of "onNativePadDown/Up" as previously done has its own issue:
If an SDL joystick is connected *and* opened, then a proper KeyEvent, say with keycode KEYCODE_BUTTON_1, should lead to an SDL joystick button event as expected.
If, however, the joystick was *not* opened, then "onNativePadDown/Up" will return a negative value, so before the commit from bug 3426, you could unexpectedly get a keyboard event. (In practice, you'll just get a log message, since KEYCODE_BUTTON_1 has no mapping to a proper SDL_ScanCode value, but it's still an problem).
What should still be done, though, is checking the key code itself. We do have the KeyEvent.isGamepadButton method, but according my test, it returns "true" exactly (and only) for the KEYCODE_BUTTON* values, and not for KEYCODE_DPAD* or any other key code.
Here is a possible solution:
- Do check the return codes of "onNativePadDown/Up" as previously done.
- In addition, in "Android_OnPadDown/Up" from src/joystick/android/SDL_sysjoystick.c, 0 should *always* be returned in case the key code can be translated to an SDL_joystick button; Even if no matching joystick can be found.
|
|
83cb2b63
|
2016-10-14T06:57:55
|
|
Fixed bug 2758 - Android issues with NDK r10c and API-21
Sylvain
After a long time, I found out more clearly what was going wrong.
The native libraries should be built with a "APP_PLATFORM" as low as possible.
Ideally, APP_PLATFORM should be equals to the minSdkVersion of the AndroidManifest.xml
So that the application never runs on a lower APP_PLATFORM than it has been built for.
An additional good patch would be to write explicitly in "jni/Application.mk": APP_PLATFORM=android-10
(If no APP_PLATFORM is set, the "targetSdkVersion" of the AndroidManifest.xml is applied as an APP_PLATFORM to the native libraries. And currently, this is bad, because targetSdkVersion is 12, whereas minSdkLevel is 10.
And in fact, there is a warning from ndk: "Android NDK: WARNING: APP_PLATFORM android-12 is larger than android:minSdkVersion 10 in ./AndroidManifest.xml".)
to precise what happened in the initial reported test-case:
Let say the "c" code contains a call to "srand()".
with APP_PLATFORM=android-21, libSDL2.so contains a undef reference to "srand()".
with APP_PLATFORM=android-10, libSDL2.so contains a undef reference to "srand48()".
but srand() is missing on devices with APP_PLATFORM=android-10 (it was in fact replaced by srand48()).
So, if you build for android-21 (where srand() is available), you will really have a call to "srand()" and it will fail on android-10.
That was the issue. The path tried to fix this by in fact always calling srand48().
SDL patches that were applied are beneficial anyway, there are implicitly allowing they backward compatibility of using android-21 on a android-10 platform.
It can be helpful in case you want to target a higher APP_PLATFORM than minSdkVersion to have potentially access to more functions.
Eg you want to have access to GLES3 functions (or other) of "android-21". But, if dlopen() fails (on android-10), you do a fall-back to GLES2.
|
|
05ca784e
|
2016-10-02T22:32:50
|
|
Android: Fixed compile error.
|
|
4e6f2199
|
2016-10-01T15:14:48
|
|
Fixed bug 3065 - Screen is flickering during closing on-screen keyboard on Android
Deve
When I'm trying to close on-screen keyboard using SDL_StopTextInput() function by touching the screen (SDL_FINGERUP or SDL_FINGERDOWN event), the screen is flickering. It is white for a while.
Note that it usually works without problems when I use phone's "back" button. I noticed flickering occasionally too, but not that often.
Philipp Wiesemann
The attached patch maybe fixes the flicker but not the actual fault causing it.
|
|
257c8972
|
2016-09-29T16:52:48
|
|
Fixed bug 3426 - Fixes for joystick related issues
ny00
This report is going to cover three issues, with a suggestion for fixes. For reference, tests were done using an installation of android-x86-5.1-rc1.iso within a VirtualBox session. I've actually used an adapter that accepts up to two Playstation 1/2 controllers.
A ZIP file should be attached, with the following contents:
- The patch file itself.
- Outputs of joysticks lists from testjoystick with different orders (before fixing bug).
- Game controllers database entries (for reference).
--- Different outputs for different platforms may stem from different tools being used; The Android mapping was manually constructed using a previously available mapping as a base.
--- Note that it turns out the Linux mapping is already out there in some form: https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
And so, let's begin listing the issues:
1. While changeset https://hg.libsdl.org/SDL/rev/9b540bea3cf1 has good intentions, it appears to make various input devices being mistakenly detected as SDL joysticks. I got lists of the devices from joysticktest, given in the ZIP file. "badordering.txt" is what I get if the device has been plugged since a reboot of the virtual machine, while I've gotten "goodordering.txt" after hot-plugging the USB adapter. As expected, only in the latter case I could use the controller in the test program (assuming it isn't modified).
To take care of this, I updated pollInputDevices and added the function SDLActivity.isDeviceSDLJoystick, in order to have a better filter. Note that it also checks that the device id is non-negative, since VIRTUAL_KEYBOARD appears to include a SOURCE_DPAD, and I should probably keep accepting it as an SDL_joystick (good if you want, say, to support multiple independent d-pad devices).
I hope the device id filter does not break support for the virtual remote (mentioned in the changeset above).
2. So there's a weird glitch here, where the game controller is reported to have SOURCE_KEYBOARD and SOURCE_JOYSTICK, while each controller button press/release emits a KeyEvent with SOURCE_KEYBOARD only. So obviously any test going over the event's own sources is expected to fail.
It is possible to try and filter by the key code, but then there are the dpad key codes, which can also be emitted by actual PC keyboard's key presses/releases (the arrow keys).
So instead, I just call the newly added isDeviceSDLJoystick function again and check if the input device (not the event) has any source considered to be a joystick/gamepad for us.
3. Finally, if SDL2 properly detects an SDL_Joystick being connected, but it is not opened, then whenever a KeyEvent is received after a button press/release from the same controller, SDLActivity.onNativePadDown/onNativePadUp returns a negative value. In such a case, the onKey handler continues to check for SOURCE_KEYBOARD (and possibly also SOURCE_MOUSE), which is clearly not desired.
And so, in the given patch, the return values of onNativePadDown and onNativePadUp are ignored and "true" is returned either way.
(Note: Maybe the native functions should be modified to have the return value of "void".)
Finally, as another side-note, I've noticed that the various bitwise tests for sources are wrong. For instance, to check if an InputDevice 'device' has source SOURCE_JOYSTICK, the value (device.getSources() & SOURCE_JOYSTICK) should be compared to SOURCE_JOYSTICK, not 0.
However, I think there's enough that this patch covers. At the least, isDeviceSDLJoystick partially solves this.
|
|
f369d165
|
2016-09-29T16:40:34
|
|
Fixed bug 3427 - Android accelerometer z-axis incorrect
Alex Szpakowski
As seen here https://bitbucket.org/rude/love/issues/1202/accelerometer-z-axis , the Java code for sending accelerometer data to SDL's C code has an incorrect Z-axis calculation.
|
|
379a4304
|
2016-08-30T21:15:46
|
|
Android: Removed unused internal function.
|
|
8f0af773
|
2016-08-11T22:04:49
|
|
android: implement audio capture support.
|
|
3853f7cd
|
2016-07-27T20:47:08
|
|
Android: Updated a comment.
|
|
242c3480
|
2016-07-27T20:46:18
|
|
Android: Replaced deprecated AbsoluteLayout with RelativeLayout.
Fixes Bugzilla #2211.
|
|
8f17b203
|
2016-07-04T10:39:32
|
|
Commit KEYCODE_SPACE as text input on Android
|
|
bb9dcf57
|
2016-04-25T22:17:38
|
|
Android: Updated name of README file.
|
|
88f51937
|
2016-01-26T22:20:05
|
|
Android: Fixed ignoring a return value while handling motion events.
This should not have caused problems yet because the return value was identical.
|
|
2191abb2
|
2016-01-13T19:31:03
|
|
Android: Fixed finishing Activity on some devices if right mouse button pressed.
Partially fixes Bugzilla #3227.
|
|
46cb8510
|
2016-01-12T22:22:24
|
|
Android: Fixed a comment.
|
|
2a4855f9
|
2015-10-15T22:26:00
|
|
Android: Added missing import statement.
It did not compile without.
|
|
82603b60
|
2015-10-15T12:52:00
|
|
Fix some Android keyboards that didn't work properly.
This conversation came from Joshua Granick on Twitter, starting here:
https://twitter.com/singmajesty/status/653640543675641857
"We found an issue where certain Android keyboards (like the S6 with
predictive text) wouldn't work ... Certain keyboards use a predictive text
mode that does not dispatch a traditional onKey events, which is troublesome
... but telling the OS to use a "visible password" keyboard helps deal with
this problem ... perhaps there's some other way (onKeyPreIme?) to do
"textediting" events, but for now, this should be a fast fix ...
I hear it affects the Galaxy Tab A 8.0", Galaxy S6, Asus ZenPhone 2, maybe
others"
|
|
5bc93cc5
|
2015-10-07T21:16:40
|
|
Android: Added a new method in SDLSurface.
|
|
10daf1f4
|
2015-09-27T20:12:47
|
|
Android: Removed three internal functions not used by SDL.
They were not needed internally since the switch to the common EGL backend.
Thanks to the SDL mailing list for pointing out that the functions seem unused.
|
|
40364541
|
2015-09-18T21:26:28
|
|
Android: Improved last error message for failed APK expansion file use.
|
|
625d39b1
|
2015-09-17T22:36:11
|
|
Android: Added additional error messages for APK expansion file use.
|
|
6e7c479e
|
2015-09-17T22:30:24
|
|
Android: Fixed trying to read from APK expansion files without version hint set.
This also fixed overwriting the asset error message which is more useful if no
APK expansion files are available and the requested file was not found.
|
|
92ca42d9
|
2015-09-17T22:24:54
|
|
Android: Renamed SDLActivity's Java method used for APK expansion files.
The name was not correct.
|
|
68b3b542
|
2015-09-17T22:14:37
|
|
Android: Removed empty onDraw() override method from SDLActivity.
It was redundant because SDLActivity already inherits an empty method from the
base class SurfaceView (which does not implement it but inherits it from View).
Visibility of onDraw() in SDLActivity is now protected again instead of public.
|
|
a4a5483f
|
2015-09-05T20:21:35
|
|
Android: Fixed unused variable warning.
|
|
2b6f6422
|
2015-09-05T20:21:06
|
|
Android: Fixed missing break warning.
|
|
0e45984f
|
2015-06-21T17:33:46
|
|
Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
|