Commit Graph

279 Commits

Author SHA1 Message Date
divVerent 1545b233a6 Fix Xbox One gamepad axis assignment on SDL_JOYSTICK_ANDROID API (#7405)
(cherry picked from commit 6f1f586086a18ab32ddccc05e4616aac02774a1b)
(cherry picked from commit 91ad208d18d86fab25f3993f2d55794d39ead9c7)
2023-03-18 11:43:13 -07:00
Sam Lantinga 07d0f51fa2 Updated to version 2.26.4 for release 2023-03-06 15:52:05 -08:00
Sam Lantinga adf31f6ec0 Updated to version 2.26.3 for release 2023-02-06 14:08:14 -08:00
Sam Lantinga f070c83a60 Updated to version 2.26.2 for release 2023-01-03 06:45:18 -08:00
Sam Lantinga f17058b562 Updated to version 2.26.1 for release 2022-12-01 11:54:51 -08:00
Sam Lantinga 0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Sam Lantinga 78ea6af2cd Updated to version 2.25.1 for release candidate 2022-11-17 09:01:35 -08:00
Sam Lantinga b4aba10154 Reverted game controller buttons from interacting with message box dialogs
These would only work for non-HIDAPI controllers, and other controller input would leak past the dialog, both of which would be confusing.
2022-10-06 12:10:46 -07:00
Sam Lantinga 893c87b27b Fixed game controller buttons being unresponsive when the on-screen keyboard is up
Also mapped controller A and B buttons to interact with messagebox dialogs
2022-10-06 12:10:45 -07:00
Sylvain fdef96e233
Android: remove "nativeSetComposingText" since it's not used anymore
(and it may fail registering at init if code is cleaned with proguard)
2022-10-04 12:08:09 +02:00
Sam Lantinga 5291e5cb76 Added version checking to SDLActivity.java
Make sure the SDL java and C code match when updating SDL in a game.
Right now we're assuming that we only have to make sure release versions match. We can extend the version string with an interface version if we need more fine grained sanity checking.

Fixes https://github.com/libsdl-org/SDL/issues/1540
2022-10-03 17:36:17 -07:00
Sam Lantinga 6acc7a5622 Mark the editbox as multi-line so the return key is always visible
Fixes https://github.com/libsdl-org/SDL/issues/6170
2022-09-30 17:45:08 -07:00
Sam Lantinga 257cacab18 Android text input now works like iOS, where you get text in progress and then backspaces and new text if autocomplete changes it or the IME commits it. 2022-09-30 17:25:58 -07:00
Sam Lantinga 82e341bc9e Android: use real editable text and mimic the edit operations to generate key events
This fixes issues where the IME and the output would get out of sync
2022-09-30 11:40:29 -07:00
yurii levchenko 3ce3594e38 Split SDLSurface to public class
Add SDLActivity method createSDLSurface
2022-08-22 14:57:15 -07:00
Sam Lantinga be3a945a8b Added support for the 8BitDo Ultimate Wired Controller for Xbox 2022-07-20 11:05:55 -07:00
Sam Lantinga 986818143d Fixed missing imports in SDLActivity (thanks @guusw!) 2022-07-18 07:20:58 -07:00
Sam Lantinga 27d8cbf026 Added PowerA and Qanba vendors for Android USB device support 2022-07-12 18:18:00 -07:00
Sam Lantinga 209f457ea4 Generate backspaces for the text we're going to replace when committing text 2022-07-01 10:13:19 -07:00
Sam Lantinga 7ac5d616f3 Fixed backspace being delivered after committed text on Android 12
Testing:
Enter "hello ", followed by "?" - the events generated are:
: commitText hello
: Key pressed :  scancode 11 = H, keycode 0x00000068 = H  modifiers: (none)
: Key released:  scancode 11 = H, keycode 0x00000068 = H  modifiers: (none)
: Key pressed :  scancode 8 = E, keycode 0x00000065 = E  modifiers: (none)
: Key released:  scancode 8 = E, keycode 0x00000065 = E  modifiers: (none)
: Key pressed :  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key released:  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key pressed :  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key released:  scancode 15 = L, keycode 0x0000006C = L  modifiers: (none)
: Key pressed :  scancode 18 = O, keycode 0x0000006F = O  modifiers: (none)
: Key released:  scancode 18 = O, keycode 0x0000006F = O  modifiers: (none)
: Key pressed :  scancode 44 = Space, keycode 0x00000020 = Space  modifiers: (none)
: Key released:  scancode 44 = Space, keycode 0x00000020 = Space  modifiers: (none)
: INPUT Text (\x68\x65\x6c\x6c\x6f\x20): "hello "
: finishComposingText
: deleteSurroundingText 1 / 0
: Key pressed :  scancode 42 = Backspace, keycode 0x00000008 = Backspace  modifiers: (none)
: Key released:  scancode 42 = Backspace, keycode 0x00000008 = Backspace  modifiers: (none)
: commitText ?
: Key pressed :  scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift  modifiers: LSHIFT
: Key pressed :  scancode 56 = /, keycode 0x0000002F = /  modifiers: (none)
: Key released:  scancode 56 = /, keycode 0x0000002F = /  modifiers: (none)
: Key released:  scancode 225 = Left Shift, keycode 0x400000E1 = Left Shift  modifiers: (none)
: INPUT Text (\x3f): "?"
: setComposingText , at 1
: EDIT Text (): ""

Previously, the backspace would be delivered after the "?"
2022-07-01 08:58:08 -07:00
Sam Lantinga 37a517dc36 Re-enable IME text input on Android
In my testing, this results in text edit events followed by text input events. Any ASCII characters will generate scancode events based on a hypothetical US keyboard layout.

Fixes https://github.com/libsdl-org/SDL/issues/3377
2022-07-01 08:33:31 -07:00
Wohlstand 68beedde92 SDLActivity.java: Compatibility fix for debugSource
I did these fixes a while ago while debuggin my application, however, forgot to send them back.
2022-06-16 12:45:15 -07:00
staphen 123b9aaa41 Adjust gradle dependencies to enable the build to position assets for the APK 2022-03-15 21:57:25 -07:00
Sylvain 5b41844c75
Fixed bug #5322 - register virtual input devices as SDL_Touch device, fix compilation 2022-02-09 09:50:41 +01:00
Sylvain 3a9bbf604e
Fixed bug #5322 - register virtual input devices as SDL_Touch device because
they can send SOURCE_TOUCHSCREEN events even if getSources() doesn't declare them.
2022-02-09 09:37:36 +01:00
Sylvain 59f1e2875a
Android: add debug function to display class/sources 2022-02-08 21:50:19 +01:00
Sylvain 2df2da11f6
Android: handleMotionEvent() is checking for SOURCE_JOYSTICK. So don't handle DPAD GAMEPAD (see #5322, #2718) 2022-02-08 17:51:40 +01:00
Sylvain 1fc5dba3d5
Android: test for SOURCE_KEYBOARD / SOURCE_MOUSE. Don't compare to 0, since there are several bits (see #5322, #2718) 2022-02-08 17:41:17 +01:00
Sylvain f185711203
Fixed bug #5310: Android, Undefined reference to AAssetManager_fromJava 2022-02-08 16:18:01 +01:00
Sylvain 68dd84f1de
Android: TouchDevice -1 is reserved for SDL synthetic devce (See #5322) 2022-02-08 11:42:24 +01:00
Sylvain 14bc3bf4ec
Android: fix typo to register TOUCHSCREEN device (see #5322, #2718) 2022-02-07 22:20:05 +01:00
Temdog007 b59e75c259 Handle menu button press from controller 2022-02-02 21:21:44 -08:00
Sam Lantinga 2363ddc330 Fixed crash on Windows Subsystem for Android, which doesn't have a USB manager.
Fixes https://github.com/libsdl-org/SDL/issues/5133
2021-12-28 17:30:36 -08:00
Sylvain a1e992b110
Fixed bug #5118 - [Android] PointerIcon leak in Cursor API 2021-12-21 22:07:17 +01:00
Sylvain cd86e269e4
Fixed bug #4982 - Failed to open audio_device. Android 5.1 should be ok. 2021-11-20 19:40:26 +01:00
Sylvain b6d365677b
Fixed bug #4982 - Failed to open audio_device on Android 5.x with freq 96khz+ 2021-11-20 15:28:36 +01:00
Sam Lantinga 7ad64357ee Updated Android build environment for examples 2021-11-15 17:04:50 -08:00
Sam Lantinga 66058bbbd5 Fixed exception accessing Bluetooth devices on Android 12
Since accessing Bluetooth prompts the user for permission on both Android and iOS, and we only need it for Steam Controller support, we'll leave it off by default. You can enable it by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init()

Fixes https://github.com/libsdl-org/SDL/issues/4952
2021-11-15 16:52:56 -08:00
Sam Lantinga be5b4d980d Added nativeGetHintBoolean for Java code 2021-11-15 16:52:54 -08:00
Sam Lantinga 2f591fb0a0 Added android:exported="true" to the example Android manifest
This is needed for targeting Android 12 (API 31)
2021-11-15 12:50:02 -08:00
Anders Jenbo 93556e67e0 Update AndroidManifest.xml 2021-11-14 20:19:54 -08:00
Anders Jenbo b9c619017d [Android] Limit WRITE_EXTERNAL_STORAGE to SDK 22-
Direct access to the external storage is no longer allowed as of SDK 30. But on older version of Android you will still need WRITE_EXTERNAL_STORAGE in order to request the Download Manager to download files to your external file folder.
2021-11-14 20:19:54 -08:00
Sam Lantinga c2dd50a9a0 Fixed whitespace 2021-11-12 08:28:02 -08:00
Sam Lantinga 97c71371f2 If Android version >= API 31 PendingIntent.FLAG_MUTABLE
"If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app's security."

Thanks @FormularSumo and @cgutman
2021-11-12 01:21:29 -08:00
Sam Lantinga 544d2e6aa0 Don't try to load hidapi at startup on Android 2021-11-11 20:47:19 -08:00
Sam Lantinga ed05a0e9e7 Fixed exception trying to get USB permission
You can't set the intent to be immutable, otherwise the USB system can't set the device and permission in the response. This works fine on Android 12 without an immutable intent.
2021-11-11 20:33:02 -08:00
Sam Lantinga c877dd93c5 The hidapi code is now built into SDL, we don't need to load a shared library for it 2021-11-11 19:29:42 -08:00
Sam Lantinga dd85cc0195 Fixed whitespace 2021-11-07 13:17:54 -08:00
FormularSumo 80d19282f7 If Android version >= API 23 PendingIntent.FLAGIMMUTABLE
"If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app's security."

FLAG_IMMUTABLE was added in API 23 so that's why I'm using "> API 23". Using API 30 would also fix the Android 12 issue. Alternatively if PendingIntents should be mutable you could change it to "FLAG_MUTABLE".
2021-11-07 13:16:13 -08:00
Sylvain 8b1a2fe860
backout SDL_AndroidSetInputType() 2021-10-17 23:47:59 +02:00