android-project/app/src/main/java


Log

Author Commit Date CI Message
Sylvain 5b41844c 2022-02-09T09:50:41 Fixed bug #5322 - register virtual input devices as SDL_Touch device, fix compilation
Sylvain 3a9bbf60 2022-02-09T09:37:36 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.
Sylvain 59f1e287 2022-02-08T18:00:58 Android: add debug function to display class/sources
Sylvain 2df2da11 2022-02-08T17:51:40 Android: handleMotionEvent() is checking for SOURCE_JOYSTICK. So don't handle DPAD GAMEPAD (see #5322, #2718)
Sylvain 1fc5dba3 2022-02-08T17:41:17 Android: test for SOURCE_KEYBOARD / SOURCE_MOUSE. Don't compare to 0, since there are several bits (see #5322, #2718)
Sylvain 68dd84f1 2022-02-08T11:42:24 Android: TouchDevice -1 is reserved for SDL synthetic devce (See #5322)
Sylvain 14bc3bf4 2022-02-07T22:20:05 Android: fix typo to register TOUCHSCREEN device (see #5322, #2718)
Temdog007 b59e75c2 2022-02-02T19:21:34 Handle menu button press from controller
Sam Lantinga 2363ddc3 2021-12-28T17:30:36 Fixed crash on Windows Subsystem for Android, which doesn't have a USB manager. Fixes https://github.com/libsdl-org/SDL/issues/5133
Sylvain a1e992b1 2021-12-21T22:07:17 Fixed bug #5118 - [Android] PointerIcon leak in Cursor API
Sylvain cd86e269 2021-11-20T19:40:26 Fixed bug #4982 - Failed to open audio_device. Android 5.1 should be ok.
Sylvain b6d36567 2021-11-20T15:28:36 Fixed bug #4982 - Failed to open audio_device on Android 5.x with freq 96khz+
Sam Lantinga 66058bbb 2021-11-15T16:52:56 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
Sam Lantinga be5b4d98 2021-11-15T16:52:54 Added nativeGetHintBoolean for Java code
Sam Lantinga c2dd50a9 2021-11-12T08:28:02 Fixed whitespace
Sam Lantinga 97c71371 2021-11-12T01:21:29 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
Sam Lantinga 544d2e6a 2021-11-11T20:47:19 Don't try to load hidapi at startup on Android
Sam Lantinga ed05a0e9 2021-11-11T20:33:02 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.
Sam Lantinga c877dd93 2021-11-11T19:29:42 The hidapi code is now built into SDL, we don't need to load a shared library for it
Sam Lantinga dd85cc01 2021-11-07T13:17:54 Fixed whitespace
FormularSumo 80d19282 2021-08-19T11:40:09 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".
Sylvain 8b1a2fe8 2021-10-17T23:47:59 backout SDL_AndroidSetInputType()
Sylvain ccb12457 2021-10-17T23:17:54 Fixed bug #4843 - Can not get the ime candidatelist like chinese/japaness input method
Sylvain 325ae5c3 2021-10-13T08:35:56 Android: getCurrentOrientation uses getContext() to retrieve the activity (see bug #4825)
Sylvain 723f5cea 2021-10-12T20:58:58 Fixed bug #4825 - NullPointerException on SDLActivity.getCurrentOrientation() (Thanks Benau!)
Sylvain 98a966d1 2021-04-22T18:06:17 Android: don't need to set the SurfaceHolder format from java code It's already set with ANativeWindow_setGeometry, and eventually set/changed also by eglCreateWindowSurface. - avoid issues with older device where SurfaceView cycle create/changed/destroy appears broken: calling create/changed/changed, and leading to "deuqueBuffer failed at server side, error: -19", with black screen. - re-read the format after egl window surface is created, to report the correct one (sometimes, changed from RGBA8888 to RGB24)
Sam Lantinga 6d9c4f6c 2021-03-26T15:07:10 Added support for the wired Amazon Luna gamepad on Android
Sam Lantinga f5e9c5b7 2021-02-21T11:03:25 Chromebooks support relative mouse motion now
Amir 1a924bc0 2021-02-19T12:54:57 add SDL_AndroidShowToast for https://developer.android.com/reference/android/widget/Toast
Jordan Christiansen 70325397 2021-01-07T19:33:12 Disabled Bluetooth if BLE is not supported BluetoothManager is supported for Android API 18+. On older versions, skip Bluetooth instead of crashing.
Sam Lantinga cdd39711 2020-12-15T14:57:49 Fixed the Xbox Series X controller showing up twice on Android
Sylvain Becker 311ae829 2020-10-28T14:03:05 Android: keep compatibility with older JDK
Sylvain Becker 97cf3145 2020-10-27T21:14:49 Android: apply code simplications found with lint / Android Studio
Sylvain Becker 0360987f 2020-10-24T20:31:04 Android: fix deprecated onCreateDialog() methods
Sylvain Becker 96704168 2020-10-24T15:36:05 Android: fix Clipboard deprecated methods
Sylvain Becker b7b8ef59 2020-10-07T17:32:07 Fixed bug 5307 - Crash when joysticks hats number is odd (Thanks Sockmonsters!)
Sylvain Becker bffbc7e3 2020-10-07T14:55:23 Android: better readibility for pollHapticDevices()
Sylvain Becker 20c070d8 2020-10-07T14:41:37 Android: better readibility for pollInputDevices() and move isDeviceSDLJoystick() test at first since there are always non-joystick devices present.
Sylvain Becker a70bb58d 2020-10-05T14:09:31 Android: fix joystick allocation that can be never used
Sylvain Becker 2e38c949 2020-10-05T09:56:03 Fix bug 5303 - Touch/Mouse events simulation doesn't work on Android 11
Sylvain Becker 0467e332 2020-10-01T15:11:28 Android: small change to access to device diagonal value
Sylvain Becker 62b029f3 2020-10-01T14:43:59 Android: missing import class Uri
Sylvain Becker dd55bfe8 2020-10-01T14:41:09 Android: add helper function to open an URL/URI (see bug 2783)
Sylvain Becker 7ad71563 2020-09-25T10:42:07 Android: be sure shared libraries are loaded in onConfigurationChanged() This could fix a rare crash if: - onConfigurationChanged is called before onCreate(); or shared libraries failed to load and onConfigurationChanged() is called
Sylvain Becker 96d555e2 2020-08-17T20:09:01 Android: remove un-needed java import (bug 4297)
Sylvain Becker 965b466e 2020-08-17T19:50:20 Fixed bug 4297 - Android StrictMode policy. Remove APK expansion support "In the second half of 2021, new apps will be required to publish with the Android App Bundle on Google Play" (see https://developer.android.com/guide/app-bundle) And "Android App Bundles don't support APK expansion (*.obb) files".
Sam Lantinga d0947c14 2020-06-04T12:30:25 Fixed exception if getManifestEnvironmentVariables() is called without a current SDL activity
Sam Lantinga 68e1731e 2020-05-29T15:40:17 Don't bother logging security exception getting the device serial number This can happen anytime we haven't opened the device yet
Sockmonsters eea450bc 2020-05-29T15:37:03 - Added exception handler for the new SecurityException in USBDevice getSerialNumber
Sylvain Becker 33642b47 2020-05-08T21:50:23 Android: robustness if locale failed to be detected at start
Sylvain Becker 2491f16f 2020-05-08T21:40:28 Android: send SDL_LOCALECHANGED when locale changes
Sam Lantinga beab15b0 2020-04-27T19:12:02 Added additional logging to track down why the NVIDIA controller doesn't send the back button
Sam Lantinga 37faac0d 2020-03-05T08:43:16 Fixed java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowManager android.app.Activity.getWindowManager()' on a null object reference
Sam Lantinga 14bf532d 2020-02-13T16:10:52 Fixed opening audio on Android from the Steam Link shell activity
Sam Lantinga 4bb95e84 2020-02-11T16:14:02 Implemented OpenSL-ES audio recording on Android
Sam Lantinga 64c58b9f 2020-02-07T20:20:37 Fixed NullPointerException
Sam Lantinga c9c89783 2020-01-29T20:09:08 Miscellaneous pending fixes
Sam Lantinga 598cf694 2020-01-28T21:41:13 Fixed member order to make more sense
Sam Lantinga 43b377b0 2020-01-28T17:11:17 Fixed wired PS4 controller support on Android
Sam Lantinga ce7c51a9 2020-01-26T00:37:48 Always release devices in onPause in case we're going to be force stopped, and for consistency with interacting with other activities that might use the controller
Sam Lantinga 43aa1fa9 2020-01-18T11:21:14 Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android
Sylvain Becker d52ba78b 2020-01-17T12:04:18 Fixed bug 4246 - Android: orientation between portrait<->landscape doesn't work Improve handling of landscape/portrait orientation. Promote to SCREEN_ORIENTATION_SENSOR_* when needed. Android window can be somehow resizable. If SDL_WINDOW_RESIZABLE is set, window size change is allowed, for instance when orientation changes (provided the hint allows it).
Sam Lantinga 1d321850 2020-01-13T15:35:52 Added support for claiming individiual interfaces on USB devices on Android This is needed for supporting multiple wireless Xbox 360 controllers
Sam Lantinga a7bf6af8 2020-01-11T04:34:23 The Amlogic TVB-906X is Android TV
Sylvain Becker f050309e 2019-12-20T15:58:59 Android: fix IllegalStateException in onBackPressed() Rare exception, not catch-able, which appears when the activity gets in a broken state. java.lang.IllegalStateException: at android.app.FragmentManagerImpl.checkStateLoss (FragmentManagerImpl.java:1323) at android.app.FragmentManagerImpl.popBackStackImmediate (FragmentManagerImpl.java:493) at android.app.Activity.onBackPressed (Activity.java:2215) at org.libsdl.app.SDLActivity.onBackPressed (SDLActivity.java) at android.app.Activity.onKeyUp (Activity.java:2193) at android.view.KeyEvent.dispatch (KeyEvent.java:2685) at android.app.Activity.dispatchKeyEvent (Activity.java:2423) at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java)
Sam Lantinga 15d30298 2019-12-19T15:01:32 Added support for wireless Xbox 360 controllers using the HIDAPI driver
Sylvain Becker 5d5a5671 2019-12-19T13:54:03 Fixed bug 4906 - Pressing Back button terminates app after SDL_StartTextInput
Sam Lantinga 7b2826f6 2019-12-17T12:03:57 Added Android support for the Hyperkin X91 and the SteelSeries Stratus Duo
Sam Lantinga d4e1c797 2019-11-27T17:17:03 Backed out changeset 36b79874a9c8, which fixed bug 4775 This change broke individual key events, so I'm reverting the change until we can investigate a better fix.
Sylvain Becker 59352cea 2019-10-23T11:25:16 Fixed bug 4775 - Japanese on Android, remove inputtype PASSWORD (Thanks Tamo!)
Sylvain Becker 7f9016f2 2019-08-15T20:38:25 Android: remove tabs/indent
Sam Lantinga e92fe23c 2019-08-02T17:20:00 Fix nullptr crash on android nullcheck the device coming back from InputDevice.getDevice(deviceId) in new code added to sdlactivity.onkey. java.lang.NullPointerException: at org.libsdl.app.SDLSurface.onKey (SDLActivity.java:1793) at android.view.View.dispatchKeyEvent (View.java:13321) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912) at com.android.internal.policy.DecorView.superDispatchKeyEvent (DecorView.java:685) at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent (PhoneWindow.java:1869) at android.app.Activity.dispatchKeyEvent (Activity.java:3447) at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java:496) @dang @saml @dave
Sylvain Becker f994da0e 2019-07-03T13:37:54 Fixed bug 4702 - Android back button does not send SDL_KEYDOWN event fallback when event.getSource() is SOURCE_UNKNOWN
Sylvain Becker 5418d416 2019-06-18T11:35:30 Android: prevent ignoring surfaceChanged() in MultiWindow
Sylvain Becker 4392c6ff 2019-06-11T11:01:15 Android: fix coordinates for Surface.ROTATION_180 https://discourse.libsdl.org/t/android-screen-orientation-issues-2-0-9/26262
Sylvain Becker 45a3dd17 2019-06-11T10:19:26 Android: revert wrong fix typo calling onBackPressed() (Bug 4657)
Sylvain Becker f9a9193e 2019-06-10T21:58:03 Android: add MinimizeWindow function (Bug 4580, 4657) shouldMinimizeOnFocusLoss is un-activated (return false)
Sylvain Becker 3f4e189b 2019-06-10T21:41:22 Android: fix typo calling onBackPressed() (Bug 4657)
Sam Lantinga 8b57331e 2019-05-23T11:05:43 Fixed hiding the Android virtual keyboard when the return key is pressed
Sylvain Becker f91b8785 2019-05-23T09:08:40 Android: minimum size for IME, so that it takes focus In API 28, 0 width views can't take focus, so if someone tries to position the IME without setting a width, they'll stop getting text events. Tested on Android 9: with a 0 size, it would send correctly letters a, b, c, etc. but not numbers.
Sam Lantinga f5252530 2019-04-23T14:08:14 Change my previous fix based on feedback from dev @saml
Sam Lantinga ecce803d 2019-04-23T12:59:28 Fix compile errors I hit when building org.libsdl in source2 (part 2 of 2) @saml
Sam Lantinga 45b5453b 2019-04-23T12:59:20 Fix compile errors I hit when building org.libsdl in source2 (part 1 of 2)
Sam Lantinga 9950271b 2019-04-22T16:19:52 Fixed bug 4580 - Android 8: immersive fullscreen notification causes flickering between fullscreen and non-fullscreen and app is unresponsive Sylvain 2019-04-18 21:22:59 UTC Changes: - SDL_WINDOWEVENT_FOCUS_GAINED and SDL_WINDOWEVENT_FOCUS_LOST are sent when the java method onWindowFocusChanged() is called. - If we have support for MultiWindow (eg API >= 24), SDL event loop is blocked/un-blocked (or simply egl-backed-up or not), when java onStart()/onStop() are called. - If not, this behaves like now, SDL event loop is blocked/un-blocked when onPause()/onResume() are called. So if we have two app on screen and switch from one to the other, only FOCUS events are sent (and onPause()/onResume() are called but empty. onStart()/onStop() are not called). The SDL app, un-focused, would still continue to run and display frames (currently the App would be displayed, but paused). Like a video player app or a chronometer that would still be refreshed, even if the window hasn't the focus. It should work also on ChromeBooks (not tested), with two apps opened at the same time. I am not sure this fix Dan's issue. Because focus lost event triggers Minimize function (which BTW is not provided on android). https://hg.libsdl.org/SDL/file/bb41b3635c34/src/video/SDL_video.c#l2653 https://hg.libsdl.org/SDL/file/bb41b3635c34/src/video/SDL_video.c#l2634 So, in addition, it would need to add by default SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS to 0. So that the lost focus event doesn't try to minimize the window. And this should fix also the issue.
Sam Lantinga cf87d576 2019-04-16T20:00:14 Explicitly load hidapi as a dependency of the SDL library This fixes loading on Android 4.2
Sylvain Becker bfdd0b22 2019-04-04T17:01:02 Android: remove SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH java layer runs as if separate mouse and touch was 1, Use SDL_HINT_MOUSE_TOUCH_EVENTS and SDL_HINT_TOUCH_MOUSE_EVENTS for generating synthetic touch/mouse events
Sylvain Becker 3bc1a8b6 2019-03-13T14:08:21 Android: minor comment update
Sylvain Becker 9d10c738 2019-01-17T16:30:19 Android: remove duplicate code in SDLGenericMotionListener_API24 and use parent method
Sylvain Becker 55838d8b 2019-01-17T14:59:46 Android: remove another hard-coded constant for Samsung DeX (no op!)
Sylvain Becker 56f4a711 2019-01-17T13:42:13 Android: minor change in the evaluation of SOURCE_CLASS_JOYSTICK (no op!) InputDevice.SOURCE_CLASS_* are one bit More readable to check that the source has this class_joystick set, compared to the other statements, where the source is gamepad or dpad. (Clean-up from bug 3958)
Sylvain Becker 8f828a8e 2019-01-17T12:25:19 Android: remove hard-coded constant for Samsung DeX (no op!) 12290 = 0x3002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN SOURCE_MOUSE Constant Value: 8194 (0x00002002) SOURCE_TOUCHSCREEN Constant Value: 4098 (0x00001002) SOURCE_CLASS_POINTER Constant Value: 2 (0x00000002) https://developer.android.com/reference/android/view/InputDevice.html
Sylvain Becker e5f8801f 2019-01-17T11:05:05 Android: prevent concurrency in Android_SetScreenResolution() when exiting by checking Android_Window validity - SDLThread: user application is exiting: SDL_VideoQuit() and clearing SDL_GetVideoDevice() - ActivityThread is changing orientation/size surfaceChanged() > Android_SetScreenResolution() > SDL_GetVideoDevice() - Separate function into Android_SetScreenResolution() and Android_SendResize(), formating, and mark Android_DeviceWidth/Heigh as static
Sylvain Becker 291f6006 2019-01-16T09:22:20 Android: merge SDLJoystickHandler_API12 and SDLJoystickHandler_API16
Sylvain Becker a8675416 2019-01-16T09:12:31 Android: remove trailing spaces
Sylvain Becker d86de288 2019-01-16T09:11:13 Android: remove old code after Android-16 has been set as minimum requirement
Sylvain Becker dc263450 2019-01-14T23:33:48 Android: create Pause/ResumeSem semaphore at higher level than CreateWindow() - If you call onPause() before CreateWindow(), SDLThread will run in infinite loop in background. - If you call onPause() between a DestroyWindow() and a new CreateWindow(), semaphores are invalids. SDLActivity.java: the first resume() starts the SDLThread, don't call nativeResume() as it would post ResumeSem. And the first pause would automatically be resumed.
Sylvain Becker ae41831e 2019-01-14T21:34:12 Android: minor, remove static attributes, move mIsSurfaceReady to SDLSurface
Sylvain Becker 42e18bd0 2019-01-11T14:25:32 Android: fix bad merge from previous commit
Sylvain Becker 7a1d1bae 2019-01-10T21:40:57 Android: add name for Touch devices and simplification, from bug 3958
Sylvain Becker d23c2f07 2019-01-10T18:05:56 Fixed bug 3930 - Android, set thread priorities and names SDLActivity thread priority is unchanged, by default -10 (THREAD_PRIORITY_VIDEO). SDLAudio thread priority was -4 (SDL_SetThreadPriority was ignored) and is now -16 (THREAD_PRIORITY_AUDIO). SDLThread thread priority was 0 (THREAD_PRIORITY_DEFAULT) and is -4 (THREAD_PRIORITY_DISPLAY).