Commit graph

128 commits

Author SHA1 Message Date
Sam Lantinga
fae0fc30b3 Provide the correct state of the on-screen keyboard to the API (patch from Sylvain) 2017-08-13 21:05:15 -07:00
Sam Lantinga
545c6ea1eb 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.
2017-08-13 20:55:59 -07:00
Sam Lantinga
9f4138162c Fixed bug 3128 - Removing all the static variables from android SDLActivity and accompanying JNI calls.
owen

I removed all the static variables from SDLActivity.java

Updated all the SDL_android.c jni calls as well

I added a new function to SDL_android.c/ h
void Android_JNI_SeparateEventsHint(const char* c);

This is called by SDL_androidtouch.c so that this TU doesn't need to call any JNI functions.
2017-08-12 12:24:59 -07:00
Sam Lantinga
976866d13d Fixed bug 3191 - haptic system on android?
Patch provided by jintiao and Milan Nikolic, thanks!
2017-08-12 08:15:09 -07:00
Philipp Wiesemann
3c56d45c02 Removed duplicate includes. 2017-06-04 23:15:47 +02:00
Philipp Wiesemann
ff2cdde541 android: Moved internal function to new position.
It was grouped with functions for the public system header.
2017-06-03 23:00:40 +02:00
Philipp Wiesemann
817d90982b android: Fixed parameter list in function definitions. 2017-05-25 23:01:16 +02:00
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
d1b2ffe485 Fixed missing prototypes on Android, patch from Sylvain 2016-12-02 02:25:12 -08:00
Philipp Wiesemann
7cbbd89bb3 Android: Fixed two warnings about unused variables. 2016-09-21 23:06:26 +02:00
Philipp Wiesemann
a3b6299185 Android: Fixed misleading warning in log output (thanks, Sylvain!).
Fixes Bugzilla #3418.
2016-08-30 21:15:18 +02:00
Ryan C. Gordon
1ef00d5809 android: implement audio capture support. 2016-08-11 22:04:49 -04:00
Philipp Wiesemann
9272534dd2 Android: Fixed missing export of a JNI function (thanks, Andrii!).
Fixes Bugzilla #3393.
2016-07-17 21:43:12 +02:00
Eric Wing
6e7137e857 Android: C89 cleanup to avoid warnings/errors since the default gcc mode on Android is still pre-C99. 2016-02-09 17:36:42 -08:00
Ryan C. Gordon
a3c8456993 Android: Fixed up drop events for new interface. 2016-01-05 05:31:33 -05:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
30f533b548 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.
2015-09-27 20:12:47 +02:00
Philipp Wiesemann
6fcd1828be Android: Added check if Java method for APK expansion file exists. 2015-09-18 21:26:46 +02:00
Philipp Wiesemann
8fa156a2f8 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.
2015-09-17 22:30:24 +02:00
Philipp Wiesemann
2ab482abc1 Android: Renamed SDLActivity's Java method used for APK expansion files.
The name was not correct.
2015-09-17 22:24:54 +02:00
Philipp Wiesemann
09c76524e5 Android: Changed return type of four JNI functions from int to jint. 2015-09-05 20:21:52 +02:00
Ryan C. Gordon
ca08bb0d98 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.
2015-05-26 20:36:45 -04:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Philipp Wiesemann
9a7c04deea Android: Fixed empty parameter list in signatures of internal functions. 2015-05-09 22:42:23 +02:00
Ryan C. Gordon
7ccd2d26a9 Patched to compile on Android (I hope). 2015-04-01 14:45:09 -04:00
Joseba García Etxebarria
e997a4144d * More Android patch work 2015-03-24 21:02:28 +01:00
Joseba García Etxebarria
3dcf5c743f * Improve mouse support in Android. These changes require Android API v12 to compile 2015-03-24 20:45:29 +01:00
Philipp Wiesemann
60192c3d03 Changed static variable to local variable in implementation for Android. 2015-01-30 23:18:14 +01:00
Philipp Wiesemann
d2aee7d409 Fixed bug 2816 - [patch] Android: Expose screen refresh rate
Jonas Kulla

Display::getRefreshRate() is available on all API levels.
2015-01-23 20:29:08 +01:00
Philipp Wiesemann
fe111b603e Removed dependency to stdbool.h in implementation file for Android.
This reduced mixing of different types in the file (bool, jboolean, SDL_bool).
2014-12-10 21:20:41 +01:00
Philipp Wiesemann
bb8a6cf785 Fixed bug 2811 - [patch] Android core: Fix JNI 'nativeGetHint' symbol not being exported
Jonas Kulla

I don't see a reason why this shouldn't be exported. Currently a strip -s on the final application library eats it.
2014-12-09 22:49:16 +01:00
Philipp Wiesemann
9ef929de0b Fixed local reference leaks in messagebox implementation for Android. 2014-11-23 20:38:18 +01:00
Philipp Wiesemann
69e989c667 Fixed setting of screen saver state crashing on some version of Android.
Setting Window flags seems to affect Views and must be handled on UI thread.
2014-10-20 22:19:09 +02:00
Gabriel Jacobo
0ec4fc6589 Bug 2739 - [Android] No support for SDL_DisableScreenSaver by Martin Gerhardy 2014-10-20 10:10:39 -03:00
Sam Lantinga
56f86cc81f Fixed bug 2415 - Message Boxes aren't implemented on Android
Philipp Wiesemann

I attached a patch for an incomplete implementation of the messagebox parts.

It was not tested on lots of devices yet and features a very fragile workaround to block the calling SDL thread while the dialog is handled on Android's UI thread. Although it works for testmessage.c I assume there are lot of situations were it may fail (standby, device rotation and other changes). Also not all flags and colors are implemented.

On the other hand most uses of the messagebox are to show an error on start and fragility (or working at all) may not matter there.
2014-09-13 02:15:18 -07:00
Sam Lantinga
e11bc486e4 Fixed compiler warning on Android 2014-06-26 12:42:15 -07:00
Sam Lantinga
f5054661e6 Merged changes from Alexey Petruchik to support Android obb files
http://developer.android.com/google/play/expansion-files.html
2014-06-21 20:35:36 -07:00
stopiccot
20623e3dad Fixing issues discovered by Philipp Wiesemann
--HG--
branch : apk
2014-04-23 03:42:32 +03:00
stopiccot
a41b3ce38b inital apk extension support
--HG--
branch : apk
2014-04-07 21:20:39 +03:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
dbrady
e2653cfbe5 fixed hat code validation. 2014-01-28 15:28:20 -08:00
Ryan C. Gordon
82edee6971 Make internal SDL sources include SDL_internal.h instead of SDL_config.h
The new header will include SDL_config.h, but allows for other global stuff.

--HG--
extra : rebase_source : ddf4a4c0dc2c554b98c82700798f343cd91b16e3
2013-11-24 23:56:17 -05:00
Gabriel Jacobo
ae184f5e89 [Android] Hotplugging support for joysticks 2013-12-10 16:24:11 -03:00
Sam Lantinga
1509359de3 Associate the environment with any thread that calls Android_JNI_GetEnv(), in case it's been manually created with pthread_create() or C++11. 2013-12-07 11:19:52 -08:00
Gabriel Jacobo
31aa9d5b81 [Android] Signal the resume semaphore after pushing the relevant events
Ref: Request in #2242
2013-12-03 12:09:58 -03:00
Gabriel Jacobo
7f809e64d8 Improve Android pause/resume behavior. 2013-11-29 10:06:08 -03:00
Philipp Wiesemann
2ca1d5c980 Fixed bug 2258 - Crash when using Android clipboard
chw

The Android clipboard manager methods must be called from the UI thread,
otherwise crashes of the dalvikvm happen.
2013-11-23 23:38:16 +01:00
Gabriel Jacobo
c68f34799d [Android] Try to improve handling of DPAD|GAMEPAD + KEYBOARD devices
It seems some devices report themselves as DPAD or GAMEPAD and KEYBOARD as well,
and we need to route different keycodes to different parts of SDL.
2013-11-19 10:00:05 -03:00
Philipp Wiesemann
830b5d9d16 Fixed implicit function declarations by including the missing header. 2013-11-10 14:39:38 +01:00
Philipp Wiesemann
82f9264294 Corrected source comment. 2013-11-10 14:36:41 +01:00