summaryrefslogtreecommitdiff
path: root/android-project/app
AgeCommit message (Collapse)AuthorFilesLines
2019-04-24Fixed bug 4566 - Hot-plugging Bluetooth controller causes force-quit on AndroidSam Lantinga1-1/+1
Anthony @ POW Games I tried adding different configChanges and sure enough, "navigation" worked! Now bluetooth controllers hot-plug nicely. So shall we add it as a default to the AndroidManifest.xml? Funny that this is how this activity is described: "navigation" The navigation type (trackball/dpad) has changed. (This should never normally happen.) I think the reason behind this is because the bluetooth game controller I was testing doubles-up as a keyboard, which probably comes with a DPAD? It's a MOCUTE-032X_B63-88CE
2019-04-23Change my previous fix based on feedback from dev @samlSam Lantinga1-1/+1
2019-04-23Fix compile errors I hit when building org.libsdl in source2 (part 2 of 2) @samlSam Lantinga1-1/+1
2019-04-23Fix compile errors I hit when building org.libsdl in source2 (part 1 of 2)Sam Lantinga1-3/+3
2019-04-22Fixed bug 4580 - Android 8: immersive fullscreen notification causes ↵Sam Lantinga1-14/+52
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/8703488687ca/src/video/SDL_video.c#l2653 https://hg.libsdl.org/SDL/file/8703488687ca/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.
2019-04-16Explicitly load hidapi as a dependency of the SDL librarySam Lantinga1-0/+1
This fixes loading on Android 4.2
2019-04-04Android: remove SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCHSylvain Becker2-24/+7
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
2019-03-13Android: minor comment updateSylvain Becker1-1/+1
2019-01-17Android: remove duplicate code in SDLGenericMotionListener_API24Sylvain Becker1-40/+13
and use parent method
2019-01-17Android: remove another hard-coded constant for Samsung DeX (no op!)Sylvain Becker1-1/+2
2019-01-17Android: minor change in the evaluation of SOURCE_CLASS_JOYSTICK (no op!)Sylvain Becker1-3/+3
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)
2019-01-17Android: remove hard-coded constant for Samsung DeX (no op!)Sylvain Becker1-1/+4
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
2019-01-17Android: prevent concurrency in Android_SetScreenResolution() when exitingSylvain Becker1-2/+4
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
2019-01-17Android: also update APP_PLATFORM to android-16 in Application.mkSylvain Becker1-1/+1
https://hg.libsdl.org/SDL/rev/8db358c7a09a https://hg.libsdl.org/SDL/rev/787e86a461f5
2019-01-16Android: merge SDLJoystickHandler_API12 and SDLJoystickHandler_API16Sylvain Becker1-17/+8
2019-01-16Android: remove trailing spacesSylvain Becker1-23/+23
2019-01-16Android: remove old code after Android-16 has been set as minimum requirementSylvain Becker3-80/+25
2019-01-14Android: create Pause/ResumeSem semaphore at higher level than CreateWindow()Sylvain Becker1-2/+6
- 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.
2019-01-14Android: minor, remove static attributes, move mIsSurfaceReady to SDLSurfaceSylvain Becker1-9/+13
2019-01-11Android: fix bad merge from previous commitSylvain Becker1-1/+0
2019-01-10Android: add name for Touch devices and simplification, from bug 3958Sylvain Becker1-6/+5
2019-01-10Fixed bug 3930 - Android, set thread priorities and namesSylvain Becker2-2/+34
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).
2019-01-10Android: remove deprecated PixelFormat in surfaceChanged()Sylvain Becker1-21/+0
Can be check by adding in build.grable: gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } } SDLActivity.java:1691: warning: [deprecation] A_8 in PixelFormat has been deprecated case PixelFormat.A_8: SDLActivity.java:1694: warning: [deprecation] LA_88 in PixelFormat has been deprecated SDLActivity.java:1697: warning: [deprecation] L_8 in PixelFormat has been deprecated SDLActivity.java:1700: warning: [deprecation] RGBA_4444 in PixelFormat has been deprecated SDLActivity.java:1704: warning: [deprecation] RGBA_5551 in PixelFormat has been deprecated SDLActivity.java:1716: warning: [deprecation] RGB_332 in PixelFormat has been deprecated
2019-01-10Android: some simplification, don't need mExitCalledFromJavaSylvain Becker1-17/+6
2019-01-10Android: nativeQuit for SDLActivity threadSylvain Becker1-0/+3
- destroy Android_ActivityMutex - display any SDL error message that may have occured in this thread, since SDL_GetError() is thread specific, and user has no access to it.
2019-01-10Android: only send Quit event to SDLThread if it's not already terminatedSylvain Becker1-5/+7
And it avoids reporting errors using Android_Pause/ResumeSem that are NULL.
2019-01-10Android: un-needed transition to Pause state.Sylvain Becker1-9/+9
- Don't need to go into Pause state, since onPause() has been called before. - Don't need to call nativePause is SDLThread is already ended
2019-01-09Android: prevent a dummy error message sending SDL_DISPLAYEVENT_ORIENTATIONSylvain Becker1-0/+1
In the usual case, first call to onNativeOrientationChanged() is done before SDL has been initialised and would just set an error message "Video subsystem has not been initialized" without sending the event.
2019-01-09Android: native_window validity is guaranteed between surfaceCreated and ↵Sylvain Becker1-0/+2
Destroyed It's currently still available after surfaceDestroyed(). And available (but invalid) between surfaceCreated() and surfaceChanged(). Which means ANativewindow_getWidth/Height/Format() fail in those cases. https://developer.android.com/reference/android/view/SurfaceHolder.html#getSurface()
2019-01-07Android: don't allow multiple instance of SDLActivitySylvain Becker2-11/+5
Default launch mode (standard) allows multiple instances of the SDLActivity. ( https://developer.android.com/guide/topics/manifest/activity-element#lmode ) Not sure this is intended in SDL as this doesn't work. There are static variables in Java, in C code which make this impossible (allow one android_window) and also Audio print errors. There is also some code added in onDestroy as if it would be able to re-initialize: https://hg.libsdl.org/SDL/rev/56e9c709db7e Bug Android activity life-cycle seems to show there is not transition to get out of onDestroy() https://developer.android.com/reference/android/app/Activity#ActivityLifecycle ( can be tested with "adb shell am start my.package.org/.MainActivity" and "adb shell am start -n my.package.org/.MainActivity" ) Send me a message if there are real use-case for this !
2019-01-05Android: remove SURFACE_TYPE_GPU, deprecated in API level 5.Sylvain Becker1-1/+0
https://developer.android.com/reference/android/view/SurfaceHolder This constant was deprecated in API level 5. this is ignored, this value is set automatically when needed.
2019-01-02Fixed bug 3250 - Wrong backbuffer pixel format on Android, keep getting RGB_565Sylvain Becker1-0/+35
Use the egl format to reconfigure java SurfaceView holder format. If there is a change, it triggers a surfaceDestroyed/Created/Change sequence.
2019-01-02Android: make sure surfaceChanged try to enter into 'resumed' state.Sylvain Becker1-0/+1
2019-01-02Fixed bug 4424 - Android windowed mode is broken (Thanks Jonas Thiem!)Sylvain Becker1-1/+1
2018-11-02Fixed bug 4320 - Android remove reflection for HIDDeviceBLESteamControllerSam Lantinga1-6/+8
Sylvain Uneeded use of reflection to access connectGatt method in HIDDeviceBLESteamController.java The method is API 23 https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#connectGatt(android.content.Context,%20boolean,%20android.bluetooth.BluetoothGattCallback,%20int)
2018-11-02Fixed bug 4319 - Android remove reflection for PointerIconSam Lantinga1-24/+24
Sylvain Since SDL2 min requirement is Android SDK 26, and PointerIcon is 24. We don't need reflection to access it.
2018-10-28Updated Android project files and documentationSam Lantinga3-13/+5
2018-10-23Fixed reinitializing the SDL joystick subsystem on AndroidSam Lantinga1-20/+17
2018-10-22Change our fullscreen wait logic to only wait if we need to. (thanks Rachel!)Sam Lantinga1-8/+48
2018-10-22Handle failure to load hidapi gracefullySam Lantinga2-4/+29
2018-10-16Fixed bug 4318 - Android move Haptic code to API26 classSam Lantinga1-53/+49
Sylvain - Create SDLHapticHandler_API26 - No need of reflection since SDL2 compile with Android 26 as a min requirement. - remove spaces
2018-10-16Support vibration magnitude on Android 8.0 (thanks Rachel!)Sam Lantinga1-4/+45
2018-10-09Added support for surround sound and float audio on AndroidSam Lantinga1-59/+249
2018-10-09Removed unneeded variable qualifiersSam Lantinga1-4/+3
2018-10-08Fixed life-cycle issues with two activities sharing HIDDeviceManagerSam Lantinga2-19/+40
2018-10-08Close on shutdown, for consistencySam Lantinga1-0/+2
2018-10-08Trying to track down NullPointerException in USB input threadSam Lantinga1-1/+10
2018-10-04Allow SDL to use ReLinker if present.Sam Lantinga4-5/+52
This fixes issues for applications that have a large number of shared libraries For more information, see https://github.com/KeepSafe/ReLinker for ReLinker's repository.
2018-10-02The Amlogic X96 is a set-top boxSam Lantinga1-0/+3
2018-10-01Fixed UnsatisfiedLinkError when initializing the HIDDeviceManager in some casesSam Lantinga1-1/+13