Commit Graph

93 Commits

Author SHA1 Message Date
Sam Lantinga
d3253877f5 Fixed compiler warning on Android 2014-06-26 12:42:15 -07:00
Sam Lantinga
b69ed39252 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
17b9ef82d9 Fixing issues discovered by Philipp Wiesemann
--HG--
branch : apk
2014-04-23 03:42:32 +03:00
stopiccot
df6159bfef inital apk extension support
--HG--
branch : apk
2014-04-07 21:20:39 +03:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
dbrady
99745583e9 fixed hat code validation. 2014-01-28 15:28:20 -08:00
Ryan C. Gordon
03d5719413 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.
2013-11-24 23:56:17 -05:00
Gabriel Jacobo
3bbcbd6cb5 [Android] Hotplugging support for joysticks 2013-12-10 16:24:11 -03:00
Sam Lantinga
97123358b0 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
34194bba7c [Android] Signal the resume semaphore after pushing the relevant events
Ref: Request in #2242
2013-12-03 12:09:58 -03:00
Gabriel Jacobo
7d161bc0bd Improve Android pause/resume behavior. 2013-11-29 10:06:08 -03:00
Philipp Wiesemann
068ec0d37d 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
50454ffe1f [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
860dff18ce Fixed implicit function declarations by including the missing header. 2013-11-10 14:39:38 +01:00
Philipp Wiesemann
1ddc152b14 Corrected source comment. 2013-11-10 14:36:41 +01:00
Gabriel Jacobo
becbba3801 [Android] Fixes Bug 2041 - can't get SDL_QUIT event...
Thanks to Denis Bernard!

Also, changed the Android manifest so the app doesn't quit with orientation
changes, and made testgles.c exit properly on Android.
2013-11-06 11:23:24 -03:00
Gabriel Jacobo
515ee991e4 Adds Joystick support for Android
This bumps the build SDK level to 12 (up from 10). Runtime requirements remain
the same (at API level < 12 joystick support is disabled).

Also enables building SDL for armv7 and x86.
2013-11-05 20:07:39 -03:00
Sam Lantinga
cefa9bb5ba Fixed a crash initializing Android touch IDs 2013-10-20 23:23:25 -07:00
Philipp Wiesemann
f50e84c7c2 Added detection of touch devices before first touch events happen on Android.
On Android available touch devices are now added with video initialization (like
the keyboard). This fixes SDL_GetNumTouchDevices() returning 0 before any touch
events happened although there is a touch screen available. The adding of touch
devices after a touch event was received is still active to allow connecting
devices later (if this is possible) and to provide a fallback if the new init
did not work somehow. For the implementation JNI was used and API level 9 is
required. There seems to be nothing in the Android NDK's input header (input.h)
to implement everything on C side without communication with Java side.
2013-10-05 17:08:19 +02:00
Gabriel Jacobo
8515791f86 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
871473e032 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Gabriel Jacobo
f93c78450b More non C89 compliant comments 2013-08-20 20:34:40 -03:00
Gabriel Jacobo
84f07d804a Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Gabriel Jacobo
d0ac9f02aa Start Android Audio Thread after audio buffer and AudioTrack are ready.
Also, it starts the Audio Thread from the native side, putting the code in line
with other backends.
2013-08-08 21:25:09 -03:00
Philipp Wiesemann
8aa3fca78a Added missing function prototype and changed its signature.
Signature was changed to prevent a header for SDL_GLContext.
2013-08-04 23:38:25 +02:00
Sam Lantinga
a55a716143 Allow C++ code to include SDL_android.h
Alexey Petruchik

Although SDL_android.h is not intended to be included by client code sometimes it needed. For example you need JNIEnv pointer to make JNI calls to modified SDLActivity.java (video playback, facebook integration, in-apps). It seems a bit weird to write:

extern "C" {
#include "SDL_android.h"
}

in my AndroidJNI.cpp file.
2013-08-04 09:23:55 -07:00
Philipp Wiesemann
acff4dec41 Added missing return statement. 2013-08-03 23:40:28 +02:00
Philipp Wiesemann
54bd7cde7b Fixed calling JNI method in a wrong way.
Method is void and does not return bool.
2013-08-03 23:36:07 +02:00
Gabriel Jacobo
8d20160ad0 Fixes bug #1889, allows for GL Context deletion/recreation on Android
Thanks ny00!
2013-08-03 12:54:39 -03:00
Gabriel Jacobo
4b9c3c0664 Temporary fix for bug #1639 SDL does not message back closing of screen keyboard
See FIXME notes on patch for details.
2013-08-02 12:38:39 -03:00
Gabriel Jacobo
b5b67aacf8 Fix for bug 2001, verify that the AudioTrack is properly initialized
...and fail to initialize the audio backend if it's not!
2013-07-31 10:04:59 -03:00
Philipp Wiesemann
4f10b00b2b Removed C++ macro setup in internal header for Android port which is only C now. 2013-07-27 14:06:06 +02:00
Philipp Wiesemann
499372f2c1 Corrected return value to be of correct type. 2013-07-24 22:25:17 +02:00
Philipp Wiesemann
1af8caa0a0 Corrected internal documentation in source.
The parameter silent is no longer optional.
2013-07-24 22:23:19 +02:00
Philipp Wiesemann
addf454fb9 Removed unreachable code. 2013-07-24 22:20:03 +02:00
Eric Wing
03cc44af03 Android: Removed all unnecessary dependencies on C++.
C++ is a bit of a minefield on Android. Much functionality still doesn't work, and Android can't decide on which C++ standard library to use, so it provides 3 different ones, all of which are incompatible with each other. (It looks like clang is coming too which will add a new compiler and a 4th standard library.)

As middleware, SDL might be distributed as a binary and intermixed with other projects already using C++. If C++ is intermixed in a bad way, bad things will happen. Removing dependencies on C++ will avoid this problem and downstream users won't have to worry/care.
2013-07-22 02:51:45 -07:00
Philipp Wiesemann
ac7859a2dc Fixed SDL_RWread() returning -1 as unsigned instead of 0 if error on Android.
Found by Cppcheck (pointed out check of unsigned < 0 which was left in place).
2013-07-07 16:11:29 +02:00
Philipp Wiesemann
36e6e25ae1 Moved prototype for static function out of header file to prevent warnings. 2013-05-30 23:25:03 +02:00
Philipp Wiesemann
0156bfbfcc Changed line comments in header file. 2013-05-30 23:08:35 +02:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
3beb70c4bc Added mobile application events, with implementations for iOS and Android 2013-05-18 12:48:50 -07:00
Philipp Wiesemann
b6c14af95e Changed signatures of methods in Java file to return boolean, adapted C++ file.
This way more checking for errors is possible which is currently not done here.
2013-05-05 15:54:56 +02:00
Philipp Wiesemann
f307a3299f Removed unused variables from C source files. 2013-04-29 23:54:22 +02:00
Gabriel Jacobo
d1ec7f2e3c Moved warning about SDL_AndroidGetActivity to SDL_system.h 2013-04-23 16:44:54 -03:00
Gabriel Jacobo
188bcf698a Fixes #1815, don't release the LocalRef returned by SDL_AndroidGetActivity 2013-04-22 11:18:45 -03:00
Sam Lantinga
e52fbd7243 Fixed bug 1780 - SDL_RWFromFile() sets an error on Android although a valid SDL_RWops pointer is returned.
Philipp Wiesemann

SDL_RWFromFile() sets an error to be queried with SDL_GetError() on Android although a valid SDL_RWops pointer is returned.

This happens if the fallback implemented in SDL_android.cpp is used to load compressed assets (see README.android in section "Loading assets") and results in a message like "java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed". I think this is confusing and not needed because the loading works as expected.

I attached a patch which changes SDL_android.cpp to not set an error if compressed assets are loaded. In this case also no Exception is queried and no additional string are created.
2013-04-02 07:57:37 -07:00
Gabriel Jacobo
b19f55242a Backed out changeset: 9cef1005df5f 2013-04-01 13:20:22 -03:00
Ryan C. Gordon
16cdc59bab Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Sam Lantinga
91094c910e Fixed bug 1700 - Joysticks not supported in Android 2013-03-19 23:03:57 -07:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00