android-project


Log

Author Commit Date CI Message
Sam Lantinga 616827ae 2017-12-19T11:19:10 Fixed bug 4001 - Android, prevent error message box to crash Sylvain Prevent the error message box to crash after being clicked. Because of "SDLActivity.mSingleton.finish();"
Sam Lantinga b92e2f02 2017-12-19T10:57:21 Fixed bug 4004 - iOS: don't hide keyboard on RETURN Dominik Reichardt As discussed in 2012 the iOS onscreen keyboard hides when you hit RETURN (see https://discourse.libsdl.org/t/on-screen-keyboard-change/19216). IMO this is a bad idea to not be able to influence this behavior and just recently this was fixed for Android by adding the hint SDL_HINT_ANDROID_RETURN_HIDES_IME in changeset 11768 6ce3bb5e38a5.
Sam Lantinga 2afc0b7f 2017-12-12T12:52:23 Add the ability to set SDL to handle Return as 'hide IME' on Android softkeyboard. (thanks Rachel!)
Sam Lantinga c317ab97 2017-11-12T10:59:05 Fixed Android build error on older SDK
Sam Lantinga 50e422ad 2017-11-04T22:03:28 Fixed bug 3917 - Android, issues with getManifestEnvironmentVariable Sylvain What about getting some return code instead of creating another native function.
Sam Lantinga 758156a7 2017-11-04T09:37:29 Fixed bug 3917 - Android, issues with getManifestEnvironmentVariable We're going to push the manifest environment variables from the Java side instead of continually querying for them from the native side.
Sam Lantinga bb8c3a9c 2017-11-02T10:41:55 Make SDL fullscreen windows on Android actually fullscreen
Sam Lantinga 522901b8 2017-11-02T08:46:14 Fixed bug 3933 - Android, no need of the listener thread Sylvain A listener thread has been added to know when the native thread would end. But now, it is more easy to only check that after the main function has returned. It's one thread less.
Sam Lantinga 8c465802 2017-11-01T18:41:11 Allow the activity to persist through connecting or disconnecting a keyboard
Sam Lantinga 62c3acaf 2017-11-01T18:40:11 Moved the meta-data into the right section
Sam Lantinga a90be440 2017-11-01T10:06:58 Added controller mapping for Android TV remotes Also fixed the back button on the remote exiting the application
Sam Lantinga 4478707b 2017-10-31T13:49:59 Add SDL_GetDisplayDPI implementation on Android. (thanks Rachel!)
Sam Lantinga 6d23ea4b 2017-10-29T21:09:09 Fixed Java string comparison with ""
Sam Lantinga 8e37bed3 2017-10-26T10:41:38 android: Fix softkeyboard issue in SDL on Android.
Sam Lantinga 8fd0c22a 2017-10-24T00:17:07 Added the ability to set SDL hints from AndroidManifest.xml (thanks Rachel!) This is especially useful for things like the accelerometer hint which could be needed before application main().
Sam Lantinga 45536710 2017-10-24T00:04:40 Fixed crash if mSurface isn't set up when we pause the application
Sam Lantinga 81f7e0c1 2017-10-23T23:35:04 Removed unneeded file automatically generated by Android Studio
Sam Lantinga b8d8a1f1 2017-10-23T23:26:40 Updated the minimum and target SDK versions in AndroidManifest.xml
Sam Lantinga edf0fae1 2017-10-23T23:23:47 Updated Android build tools version, which bumped minimum deployment target to API 14 Also added native code to the Android gradle project, which allows using gradle or Android Studio to build the entire SDL application without a separate ndk-build step.
Sam Lantinga 76cdce44 2017-10-23T23:23:34 Fixed build with older Android SDK
Sam Lantinga f08480af 2017-10-23T15:23:43 Switched to new style gradle Android application build process
Sam Lantinga c339d9ed 2017-10-20T10:29:22 Reverted changes 6acdea394736 and 1448a2ac30fe I don't want to introduce any regressions with Android TV remote support
Sam Lantinga 2001898d 2017-10-19T15:37:52 Fixed Android joystick detection
Sam Lantinga 9d9be456 2017-10-19T13:54:56 Don't use DPAD devices as joystick input on Android
Sam Lantinga dff56c34 2017-10-13T19:55:07 Android Studio code analyzer fixes
Sam Lantinga 14ed0d24 2017-09-23T12:37:09 Fixed bug 3843 - Android missing some code in SDLHapticHandler Sylvain Some check for android SDK version are missing from https://hg.libsdl.org/SDL/rev/3d7a29a369a0 here's a patch
Sam Lantinga 82557750 2017-09-22T08:31:56 Separated out SDL Android java code so audio, controller, and filesystem APIs can be used independently of the SDL activity, in Qt apps for example.
Sam Lantinga 53b2c91d 2017-09-22T08:30:46 Separated out SDL Android java code so audio, controller, and filesystem APIs can be used independently of the SDL activity, in Qt apps for example.
Sam Lantinga 6c38c900 2017-08-31T15:12:08 Update Android SDK required to API level 16 Sylvain Some API 16 methods are used (InputDevice: getDescriptor(), getVibrator()), so we need to compile at least with SDK API 16. Hence default.properties and project.properties have been modified to use android-16. There are also some modification to SDLActivity.java not to use getVibrator() if we run under API 16. And not to check to presence of hasVibrator() if we are under API 11. -some hard-coded constant can be expandend. - rename a local variable (hasVibrator to hasVibratorService)
Sam Lantinga 347fe704 2017-08-30T14:25:01 Fixed bug 3789 - Android : small clean up Sylvain Since https://hg.libsdl.org/SDL/rev/6546daa45a02 SDL_android_main.c is empty and then produce a warning nativeInit does not exist and dont need to be mark undefined
Sam Lantinga c684eb2c 2017-08-28T23:04:47 Add a way to set the context when other activities are active so many SDL API functions still work.
Sam Lantinga 60182eb7 2017-08-28T14:40:21 Allow overriding the main entry point on Android
Sam Lantinga dbb0a2aa 2017-08-28T14:34:15 Removed the need for libSDL2main.a on Android, and separated JNI initialization out for other integrations
Sam Lantinga 2a945b44 2017-08-28T10:03:39 Fixed bug 2361 - [Android] Joysticks do not have unique IDs David Brady When I attempted to make a mapping file for Android gamepads, I quickly discovered that most of the ones that I have here show up as the same device (Broadcom Bluetooth HID), meaning that it was impossible to make mappings on Android, since every device looked the same. This patch will check for the existence of the getDescriptor function added in Jelly Bean, and use it if it's there. The Android Dashboard says that the majority of Android phones should support this function, and doing it this way will not force us to bump up our API version.
Sam Lantinga c45932ba 2017-08-28T09:54:16 Fixed bug 2277 - Hardware keyboard control key sequences don't get reported chw Control key sequences from hardware keyboards (wireless/USB/bluetooth) get not properly reported on Android devices. The attached patch uses the idea from http://stackoverflow.com/questions/12337117/capture-all-ctrl-under-android to make control key sequences appear as normal SDL_KEYDOWN events instead of cooked text input.
Sam Lantinga fe21a747 2017-08-27T18:43:52 Fixed bug 2266 - please add notifications for clipboard updates on Android Sylvain Hi! here's a patch for that with two class loaded regarding API level. Test both case : before API 11 and after. I also remove now unused GetSystemServiceFromUIThread() and minor clean-up (haptic warning prototype).
Sam Lantinga 6885bc88 2017-08-27T18:36:54 Fixed bug 2265 - Voice to text feature on Android repeats some text via SDL_TEXTINPUT Sylvain Small patch for this issue. I tested it and it seems to work. - it can send several backspaces (instead of only 1). - it calls directly "sendKeyEvent()" instead of "super.sendKeyEvent()". otherwise, it would go through the android internals, calling again "onKey()". and then the "backspace" would arrive after the next "commitText()".
Sam Lantinga d03409e1 2017-08-14T06:18:08 Fixed bug 3191 - haptic system on android? Sylvain - add vibrator service in the list of haptic devices. I use an hard-coded device_id for it ...
Sam Lantinga e54eede2 2017-08-13T21:05:15 Provide the correct state of the on-screen keyboard to the API (patch from Sylvain)
Sam Lantinga 6ee66139 2017-08-13T20:55:59 Fixed bug 3235 - Make the Android window creation similar to iOS' window creation Sylvain Here's a patch. It tries to get the hint first. Resizable will allow any orientation. Otherwise it uses width/height window. setOrientation method is splitted in static and non-static, so that it can be overloaded in a user subclass. Some artefact observed : surfaceChanged() can be called twice at the beginning. When the phone starts in portrait and run a landscape application.
Sam Lantinga 0a52db54 2017-08-12T08:15:09 Fixed bug 3191 - haptic system on android? Patch provided by jintiao and Milan Nikolic, thanks!
Sam Lantinga df5898b0 2017-08-11T13:37:40 Fixed bug 3464 - Fix for Android hint SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH ny00 According to the current documentation in SDL_hints.h, if SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH is set to "0" (or not set at all) then mouse input should lead to touch events, along with corresponding *fake* mouse events with mouse id SDL_TOUCH_MOUSEID. However, while moving a mouse around (actually using a trackpad identified as a mouse), I get SDL mouse motion events with differing mouse ids, as follows: - If the mouse is moved while a mouse button is pressed, the mouse id is SDL_TOUCH_MOUSEID. - Otherwise, the mouse id for mouse motion events is 0. I've attached sample code for reference, which includes logs of the various mouse events (the "which" field is covered). I believe that no actual mouse event should arrive, if the hint is unset. In particular, no mouse motion event should arrive while no mouse button is pressed. I'm going to attach a patch which resolves this, while also disabling mouse wheel motion events.
Sam Lantinga a47bf374 2017-08-09T20:23:48 Fixed bug 3728 - [Android] crash when shared libraries are no loaded Sylvain On Android, when shared libraries are not correctly loaded (eg SDLActivity.mBrokenLibraries is true), there is a pop-up with an error message. After user dismisses the pop-up, application crashes: - because the native function "nativePause()" may no be loaded (if libSDL2.so is not loaded). - because mSurface is null.
Ryan C. Gordon a9c7bc85 2017-05-19T15:06:05 android: add screenSize to AndroidManifest's configChanges (thanks, Daniel!). Fixes Bugzilla #3448. "Starting with Android API 13, another configuration change must be declared to be handled by the app if it is desired to not let the system handle rotation itself: https://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange This will have effect if either a developer or SDL per default will set target API > 12. Currently it is set to 12, but this might change in the future, like when applying this patch: https://bugzilla.libsdl.org/show_bug.cgi?id=3445 The effect of not having this change applied is that the SDL app is destroyed upon rotation. Even when the manifest has an additional entry to e.g. always stay in landscape mode, the onDestroy() call will happen on devices that are portrait per default, when switching off screen due to power save. The device will then (at least try to) rotate into portrait to show the portrait screen lock after resume. I believe it is safe to apply this patch even with target API still set to 12, the additional parameter is simply ignored."
Ryan C. Gordon 366adae3 2017-04-07T20:17:30 android: More robust fix for screen locking in landscape (thanks, Sylvain!). Fixes Bugzilla #3562. From Sylvain: "With an android landscape application, if you quickly lock, then unlock your device, you can see sometimes a quick glitch: screen badly draws in portrait, then it correctly displays in landscape. Not talking of a smooth rotation, it's a drawing glitch. And you need to have a plain lock screen, with no model nor passphrase. I think it happens because the call to "nativeResume()" occurs sometimes too early. It should be done once you have *all* those three things (in any sequence): - onWindowsFocusChanged() set to true - onResume() called - a valid call to onSurfaceChanged() Currently, this is not the case: you don't need to have onResume() called. Just need to have isPaused, (eg onPaused()). So "isPaused" should be renamed as "isResumedCalled". But you also need some kind of isPaused state to make sure to don't call nativePause() twice (and deadlocks...). There are also redundant checks to "mHasFocus" and some creation of the initialisation thread code from onSurfaceChanged() that could me moved. So here's this patch: - add some states, so we have cleaner transitions. - make sure "onResume()" is called. - some clean up - it also goes faster in pause state (focus changed, onPause, without requiring isSurfaceReady which does seems to be needed). Tested on a few devices and it removes the glitch. But I haven't tested when the activity goes back to "init" state."
Ryan C. Gordon 2092a883 2017-03-31T23:43:53 android: fix wrong events when locking device in landscape (thanks, Joshua!). "Using an application in portrait orientation, turning off the device would dispatch SDL_APP_WILLENTERBACKGROUND, then SDL_APP_DIDENTERBACKGROUND then lock the screen. However, rotating the application the application to landscape, then turning off the device would incorrectly dispatch SDL_APP_WILLENTERBACKGROUND, SDL_APP_WILLENTERBACKGROUND, SDL_APP_WILLENTERFOREGROUND and then SDL_APP_DIDENTERFOREGROUND before locking the screen. You can imagine how this created trouble :) It appears this occurs because (on this application) turning off a device when in landscape is triggering a resize. The resize logic in SDLActivity triggers a resume. This patch has resolved the issue on my device: It prevents the dispatch of (improper) FOREGROUND events when locking the device, but we get still events when the device is turned back on and unlocked."
dmuratshin 01f66613 2017-01-12T10:58:35 fixed SENSOR_LANDSCAPE and SENSOR_PORTRAIT mode false nativeResume bug
Sam Lantinga 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.
Sam Lantinga 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.
Philipp Wiesemann 05ca784e 2016-10-02T22:32:50 Android: Fixed compile error.
Sam Lantinga 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.
Sam Lantinga 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.
Sam Lantinga 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.
Philipp Wiesemann 379a4304 2016-08-30T21:15:46 Android: Removed unused internal function.
Ryan C. Gordon 8f0af773 2016-08-11T22:04:49 android: implement audio capture support.
Philipp Wiesemann 3853f7cd 2016-07-27T20:47:08 Android: Updated a comment.
Philipp Wiesemann 242c3480 2016-07-27T20:46:18 Android: Replaced deprecated AbsoluteLayout with RelativeLayout. Fixes Bugzilla #2211.
Cole Campbell 8f17b203 2016-07-04T10:39:32 Commit KEYCODE_SPACE as text input on Android
Philipp Wiesemann bb9dcf57 2016-04-25T22:17:38 Android: Updated name of README file.
Philipp Wiesemann 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.
Philipp Wiesemann 2191abb2 2016-01-13T19:31:03 Android: Fixed finishing Activity on some devices if right mouse button pressed. Partially fixes Bugzilla #3227.
Philipp Wiesemann 46cb8510 2016-01-12T22:22:24 Android: Fixed a comment.
Philipp Wiesemann 2a4855f9 2015-10-15T22:26:00 Android: Added missing import statement. It did not compile without.
Ryan C. Gordon 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"
Philipp Wiesemann 5bc93cc5 2015-10-07T21:16:40 Android: Added a new method in SDLSurface.
Philipp Wiesemann 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.
Philipp Wiesemann 40364541 2015-09-18T21:26:28 Android: Improved last error message for failed APK expansion file use.
Philipp Wiesemann 625d39b1 2015-09-17T22:36:11 Android: Added additional error messages for APK expansion file use.
Philipp Wiesemann 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.
Philipp Wiesemann 92ca42d9 2015-09-17T22:24:54 Android: Renamed SDLActivity's Java method used for APK expansion files. The name was not correct.
Philipp Wiesemann 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.
Philipp Wiesemann a4a5483f 2015-09-05T20:21:35 Android: Fixed unused variable warning.
Philipp Wiesemann 2b6f6422 2015-09-05T20:21:06 Android: Fixed missing break warning.
Philipp Wiesemann 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().
Sam Lantinga 5db002bb 2015-06-16T23:58:09 Fixed bug 2949 - [Android] Virtual DPAD remote not registered Sylvain I have an android device to which I try to connect the google virtual remote application. https://play.google.com/store/apps/details?id=com.google.android.tv.remote The java method "pollInputDevices()" detects it as an input source 0x701 which is (SOURCE_KEYBOARD | SOURCE_GAMEPAD | SOURCE_DPAD). It it not added because it does not AND-bitwise with "SOURCE_CLASS_JOYSTICK". It's only a virtual DPAD and it works when checking also with SOURCE_CLASS_BUTTON
Sam Lantinga 33ed20fa 2015-06-16T22:16:35 Fixed bug 2774 - Android: screen distorted in Landscape after background/foreground Sylvain With a Landscape application. Going to background with Home Key, then foreground. The screen is distorted. This has been reported by Samsung. It happens on S5 and Samsung Alpha, see the video attached. I have captured the following logcat: V/SDL (20549): onResume() V/SDL (20549): surfaceCreated() V/SDL (20549): surfaceChanged() V/SDL (20549): pixel format RGB_565 V/SDL (20549): Window size:1920x1080 I/SDL (20549): SDL_Android_Init() I/SDL (20549): SDL_Android_Init() finished! V/SDL (20549): SDL audio: opening device V/SDL (20549): SDL audio: wanted stereo 16-bit 22.05kHz, 256 frames buffer V/SDL (20549): SDL audio: got stereo 16-bit 22.05kHz, 1764 frames buffer V/SDL (20549): onWindowFocusChanged(): true V/SDL (20549): onWindowFocusChanged(): false V/SDL (20549): onPause() V/SDL (20549): nativePause() V/SDL (20549): surfaceDestroyed() Background / Foreground V/SDL (20549): onResume() V/SDL (20549): surfaceCreated() V/SDL (20549): surfaceChanged() V/SDL (20549): pixel format RGB_565 V/SDL (20549): Window size:1080x1920 V/SDL (20549): surfaceChanged() V/SDL (20549): pixel format RGB_565 V/SDL (20549): Window size:1920x1080 V/SDL (20549): onWindowFocusChanged(): true V/SDL (20549): nativeResume() This seems to be related to the fact that I have in "AndroidManifest.xml": android:configChanges="..." Because of the fields: "orientation" and also "screenSize". I have looked for another way to solve the issue. Discarding the "surfaceChanged" call, based on the "requestedOrientation" and the new Orientation. It seems to be better. On my failing test case, the first "surfaceChanged()" is discarded. Sometimes the "focusChanged()" might appear between the two "surfaceChanged()", while the surface is not yet ready. Thus, discarding also the "nativeResume()". So, for robustness, a call to "nativeResume()" is added at the end of "surfaceChanged()". Some update: 1/ First I tried, to discard the surface using the current orientation (rather than width / heigh). -> that solve the issue sometimes, but not always. 2/ Samsung Certification now accepts my application that were previously failing. 3/ I personally now owns a Samsung S5, and was able to solve the issue on my side. 4/ I now use the patch and get no complaints from my users. (but I admit, nobody seemed to be complaining before neither...). 5/ I have added a v2 because of a new smart-phone called "Black Berry Passport" that has a square screen of 1440x1440. This screen has a "status bar" so the resolution is in fact : 1440x1308. (as reported by "surfaceChanged"). Problem is: the portrait resolution is in fact a Landscape! So the "v1" patch is always discarding the "surface" of BlackBerry Passport. Which is terribly bad. Hence, I added the "v2" patch not to discard the surface when aspect ratio is < 1.20. (BB 1440/1308 is : 1.1009). Which seems fair.
Philipp Wiesemann c3186d5e 2015-06-05T19:40:50 Android: Added deactivated intent filter for testing drop file support.
Philipp Wiesemann dbfd4fdd 2015-05-31T19:23:16 Android: Added missing space in three log messages. Also fixed a typo and changed tag string to constant.
Ryan C. Gordon 72a244da 2015-05-26T20:36:45 Android: Added basic drop file support (thanks, "noxalus"!). This lets SDL-based apps respond to "Open With" commands properly, as they can now obtain the requested path via a standard SDL dropfile event. This is only checked on startup, so apps don't get drop events at any other time, even if Android supports that, but this is still a definite improvement. Fixes Bugzilla #2762.
Philipp Wiesemann 1968ff04 2015-05-22T22:34:08 Android: Fixed touch pressure being out of range. According to the documentation of Android's MotionEvent, the getPressure() may return values higher than 1 on some devices. To prevent passing such values into SDL they are now corrected to 1 in Java before the JNI call (where it is assumed to be correct). Currently SDL only sends SDL_FINGERMOTION events if the touch state (position or pressure) changed. By correcting pressure down to 1 some events may get dropped in the rare case that only the pressure was changed but was out of range and the position did not change.
Philipp Wiesemann f7ac0201 2015-05-16T21:15:59 Android: Replaced logging tag strings with constant.
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Philipp Wiesemann e97fc562 2015-04-13T20:52:38 Android: Fixed lint warning about order of elements in AndroidManifest.xml.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Philipp Wiesemann 049ef9a3 2015-04-08T22:24:33 Android: Fixed calling a getter method twice.
Reto Schneider e5f9c347 2015-04-08T12:14:36 Remove trailing spaces in Android source code.
Ryan C. Gordon 8da7e8ad 2015-04-08T01:37:17 Log Android hardware at startup (thanks, rettichschnidi!). Fixes Bugzilla #2653.
Joseba Garc?a Etxebarria 41961e4f 2015-04-02T00:55:45 Cast the result of calling getButtonState to an Integer
Ryan C. Gordon f9041771 2015-04-01T12:14:56 Android: more separate-mouse-and-touch work. This avoids a hint lookup for each mouse event we get by setting a static Java variable from native code during our hint watcher callback. Also attempts to do the right thing with mouse buttons if you happen to be on an API14 (Ice Cream Sandwich, Android 4.0) or later device. We still target API12 (Honeycomb MR1, Android 3.1) for SDL 2.0.4 though. This isn't tested, so I'm pushing to see what the Android buildbot says. Stand back, I'm a professional!
Joseba Garc?a Etxebarria 73990628 2015-03-27T18:09:51 Renamed SDLGenericMotionListener back to SDLGenericMotionListener_API12
Philipp Wiesemann 37672303 2015-03-25T22:47:22 Android: Removed outdated comment from source.
Joseba Garc?a Etxebarria ca7b18e4 2015-03-24T21:02:28 * More Android patch work
Joseba Garc?a Etxebarria 387fa5dc 2015-03-24T20:45:29 * Improve mouse support in Android. These changes require Android API v12 to compile
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Philipp Wiesemann 7815393b 2015-01-31T10:32:45 Fixed wrong comment in implementation for Android.
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
Philipp Wiesemann a26a4e9e 2015-01-23T20:29:08 Fixed bug 2816 - [patch] Android: Expose screen refresh rate Jonas Kulla Display::getRefreshRate() is available on all API levels.
David Ludwig 70438be2 2014-12-03T10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
Philipp Wiesemann c121ff7f 2014-11-23T20:35:51 Added name for second Java Thread on Android.
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.