Commit Graph

302 Commits

Author SHA1 Message Date
Sylvain Becker
fc3a96e47a Android: remove pollInputDevice() in favor of InputDeviceListener (#15659) 2026-06-03 20:38:04 -07:00
NY00123
ed2c8036a7 Android: Remove unused accelerometer-related code and definitions
That also covers removal of the call `SDLActivity.onNativeAccel`,
plus a change of comment under SDL_android.c.

Definitions were previously used while an accelerometer could be listed as a joystick.
2026-05-29 13:14:09 -07:00
Ryan C. Gordon
d7ba3efe6b filesystem: Implement SDL_GetExeName() for all platforms. 2026-05-27 15:41:51 -04:00
Ryan C. Gordon
5e483dc166 android: Build the APK asset tree in the same order its listed in the file.
This tends to get you enumerations in alphabetical order, instead of them
being reverse-alphabetical.

Reference Issue #15587.
2026-05-16 15:29:46 -04:00
Ryan C. Gordon
497b2118ba android: Don't forbid paths of "" in the APK assets tree.
This would make `SDL_EnumerateDirectory("assets://")` fail.

We check for empty strings at the higher level already, before we strip out
the "assets://" prefix to pass through the tree.
2026-05-16 15:26:47 -04:00
Ozkan Sezer
e972e6a01b core/android/SDL_android.c (AddAPKDirs): add missing opening brace
fixes build errors
2026-05-16 09:08:08 +03:00
Ryan C. Gordon
37af10db4d android: Support "." and ".." in asset tree paths.
Reference Issue #15587.
2026-05-16 01:16:22 -04:00
Ryan C. Gordon
e1d623505e android: Remove call to mktime() in APK entry parsing. 2026-05-16 01:16:22 -04:00
Ryan C. Gordon
be97a18d82 android: Don't allow access to the asset tree with a path of "".
Reference Issue #15587.
2026-05-15 10:34:30 -04:00
Ryan C. Gordon
0e07b7c5e2 android: Comment out debug logging.
Reference Issue #15587.
2026-05-14 15:58:15 -04:00
crudelios
439ffd13eb Android: Add support for folder dialogs 2026-05-14 11:50:52 -07:00
Ryan C. Gordon
9672f5b68b android: Change how apps access their APK's "assets" directory.
Now they can explicitly access it with "assets://" filenames, and
SDL_GetBasePath() returns "assets://"

Fixes #15347.
Fixes #5044.
2026-05-13 17:12:36 -04:00
Nintorch
3c1636a958 Fix JoyCon mappings on Android 2026-05-04 11:49:25 -07:00
Nintorch
c699512adc Add support for joystick motion sensors on Android 2026-05-03 15:11:31 -07:00
Ryan C. Gordon
9235ac4efd android: Parsing the APK's central dir is separate from the AAssetManager.
Only parse when necessary, which it isn't when opening a file, so this is now
separated from creating the cached AAssetManager object.
2026-04-28 20:22:40 -04:00
Ryan C. Gordon
40e60452ad android: Use enough zip64 format info to see APKs with files that are > 4gb. 2026-04-28 20:22:40 -04:00
Ryan C. Gordon
bb4332bdc2 android: Parse the APK directory tree, replace AAssetManager enum/getpathinfo.
The AAssetManager won't supply this information to us, but it's just a zip
file, so we can read its central directory ourselves. We can still use
AAssetManager for file i/o to the APK's assets, so we don't have to deal with
compression and other zipfile features.

Fixes #15220.
Reference Issue #15347.
2026-04-28 20:22:40 -04:00
Sam Lantinga
5c430f8715 Fixed SDL_GlobDirectory() on asset paths on Android
Make sure we pass the original path back to the directory enumeration callback.
2026-04-08 09:09:29 -07:00
Max Seidenstücker
8f8880a8eb Merge all occurances of __func__ and __FUNCTION__ to SDL_FUNCTION 2026-02-07 07:34:11 -08:00
Sam Lantinga
5f086e7623 Updated copyright for 2026 2026-01-01 09:40:08 -08:00
MAJigsaw77
cb04dcd6f8 android: Add RGB LED support for joysticks. 2025-12-29 10:32:02 -08:00
Ryan C. Gordon
9b348ef6e8 android: Better parsing of command line arguments.
Reference Issue #14510.
2025-11-25 15:29:48 -05:00
Sam Lantinga
cc768f3e88 Allow opening asset paths starting with "./"
Fixes https://github.com/libsdl-org/SDL/issues/13933
2025-11-18 15:29:04 -08:00
Susko3
e2bbbdc515 Implement SDL_GetPenDeviceType() for Android 2025-10-13 18:43:16 -04:00
Brenton Bostick
e584d2a8a9 fill-in missing DeleteLocalRef calls 2025-10-13 09:28:29 -07:00
Sylvain Becker
71bf56c9e4 Add SDL Pinch events (#9445) 2025-10-12 14:44:23 -07:00
Sam Lantinga
1871b998cd Added SDL_EVENT_SCREEN_KEYBOARD_SHOWN and SDL_EVENT_SCREEN_KEYBOARD_HIDDEN
Fixes https://github.com/libsdl-org/SDL/issues/13049
2025-10-10 10:14:07 -07:00
Brenton Bostick
8abbb98222 Android: fix 'JVM object referenced by 'context' is of type 'Context' and it d… (#14016)
fix 'JVM object referenced by 'context' is of type 'Context' and it does not have access to method 'registerReceiver(BroadcastReceiver, IntentFilter)' declared in class 'ContextWrapper'.'
2025-09-22 08:15:48 -07:00
Brenton Bostick
8d86ee4995 fix various places where nativeSetupJNI being treated as returning int 2025-09-22 07:25:57 -07:00
Brenton Bostick
6590a5bc0b fix: Extra parameter(s) for call to 'getCacheDir()'. 2025-09-22 07:25:00 -07:00
Brenton Bostick
ed7d39b28c fix 'SDL_MessageBoxFlags' is not a valid JVM type. 2025-09-22 07:03:49 -07:00
Sam Lantinga
25b2d2c821 Use new parameter validation macro 2025-09-18 20:58:32 -07:00
Ryan C. Gordon
b8197a2291 io: rework how we set SDL_IOStream status.
This now relies on the implementation to set these flags on short reads/writes
instead of the higher level checking if SDL_SetError() was called.

Additionally (and crucially), this now sets ERROR or EOF on all short reads,
across all backends, not just when we get a zero-byte return value.

Fixes #13720.
2025-09-05 12:43:13 -04:00
Sylvain
970c0bfe96 Fixed bug #13493: Assertion failure at SDL_AddTouch with Android API 28
Java touch id should be -1 because it's reserved for internal SDL
synthetic events.
It should also not be 0, because this is SDL invalid value.
2025-08-12 18:34:42 +02:00
Alexander Batalov
b6fa89ea74 Fix directory globbing on Android 2025-08-04 23:12:54 -04:00
Ryan C. Gordon
774c0b36ea android: Different approach to SDL_GetPathInfo() for assets.
Reference Issue #13050.
2025-07-29 12:15:25 -04:00
Brenton Bostick
f361034ac3 fix typos 2025-07-27 08:10:03 -07:00
Ryan C. Gordon
515433aa8a android: If various POSIX fsops functions fail, try using AAssetManager.
This specifically affects SDL_EnumerateDirectory and SDL_GetPathInfo. Android
assets are read-only, so no need to do this for things like
SDL_CreateDirectory, etc, and the POSIX SDL_CopyFile() uses SDL_IOStream
behind the scenes, which already supports Android assets.

Fixes #13050.
2025-07-11 14:16:18 -04:00
Sam Lantinga
d7939abf42 Use consistent style for pointer declarations and casts 2025-06-18 10:03:44 -07:00
kyle-sylvestre
8e22194217 get preferred locales on android 2025-05-20 17:12:01 -07:00
Sam Lantinga
6bb16296b0 Added special handling for SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY
This hint needs to persist outside of the normal application flow, so use the environment to set the initial value, and then save the value set via SDL_SetHint() after that.

Fixes https://github.com/libsdl-org/SDL/issues/12677
2025-04-03 11:33:34 -07:00
Sylvain
3fa1bd81fe Fixed previous commit renaming {add,remove}AudioDevice to native{Add,Remove}AudioDevice 2025-03-23 17:15:40 +01:00
Sam Lantinga
49dd24e195 Fixed potentially overlapping memcpy() to use memmove() 2025-01-14 14:31:20 -08:00
Sam Lantinga
611f132fd0 Don't use a hint callback for SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY
This was originally intended to make sure that nativeAllowRecreateActivity() could be called from another thread safely, but the hint system is now thread-safe, so we don't need to use a callback here.

Fixes https://github.com/libsdl-org/SDL/issues/11938
2025-01-13 07:49:09 -08:00
Sam Lantinga
4231848791 Revert "Separate android initialization from Activity (#11891)"
This reverts commit d14c93c4b1.

This is a major breaking change for activities that inherit SDLActivity
2025-01-10 15:27:08 -08:00
Xander
d14c93c4b1 Separate android initialization from Activity (#11891) 2025-01-10 15:05:58 -08:00
Sam Lantinga
f2074d7af3 Updated copyright for 2025 2025-01-01 07:45:52 -08:00
Sam Lantinga
8704ab8422 Wait for a display resize event before sending orientation changes
Fixes https://github.com/libsdl-org/SDL/issues/9585
2024-12-30 15:49:10 -08:00
Sam Lantinga
e91c37f4dd Added support for inset handling on Android 15 2024-12-30 12:23:00 -08:00
hwsmm
f5fbdf7ed5 Make onNativePen available for Android 2024-12-26 23:50:11 -05:00