Commit Graph

913 Commits

Author SHA1 Message Date
Rémi Verschelde e292d79fb3
SCons: Add `DEV_ENABLED` defines for `target=debug` builds
This will allow adding developer checks which will be fully compiled out in
user builds, unlike `DEBUG_ENABLED` which is included in debug tempates and
the editor builds.

This define is not used yet, but we'll soon add code that uses it, and change
some existing `DEBUG_ENABLED` checks to be performed only in dev builds.

Related to https://github.com/godotengine/godot-proposals/issues/3371.
2021-10-04 11:25:02 +02:00
Hugo Locurcio 8a6bc045ea
Add logo attribution for Android, HTML5 and Linux platform icons
- Tweak the Android platform logo to remove the Android wordmark,
  as it can't be used without explicit permission.

(cherry picked from commit 1513aa9b26)
2021-09-21 17:14:59 +02:00
Marcel Admiraal cce7e6c9d6
Use current androidx Fragment library instead of legacy libraries
(cherry picked from commit 23311a6ed3)
2021-09-19 11:37:19 +02:00
PouleyKetchoupp 1454d6c670
Add support for adding plugin views behind the main view on Android
Doesn't change the default behavior, but allows plugins to add their
view behind the main view, which gives more control over what happens
with inputs and can be useful along with transparent rendering.

(cherry picked from commit 0b681d5834)
2021-09-19 11:30:21 +02:00
PouleyKetchoupp 52fdb4ece9 Window transparency support on Android
Implements per-pixel transparency feature on Android.
Allows plugins to do specific rendering and render godot UI on top
(useful for camera support with drawing on top).
2021-09-15 10:41:08 -07:00
ne0fhyk 35a98d305b Add support for Play Asset Delivery.
This only adds support for a subset of Play Asset Delivery: this causes a single install-time asset pack to always be present, but doesn't add support for dynamically downloaded asset packs.
2021-09-15 06:02:53 -07:00
Rémi Verschelde 815c16ae17
Merge pull request #52515 from m4gr3d/android_export_refactoring
[3.x] Refactor Android platform export structure
2021-09-15 14:03:53 +02:00
Marcus Brummer 128208d1d0
Check if vibration duration is > 0 on Android
(cherry picked from commit 47f338fc12)
2021-09-14 13:41:25 +02:00
ne0fhyk 0cfbe354d7 Refactor Android platform export structure. 2021-09-09 10:48:29 -07:00
Fredia Huya-Kouadio 5b8d7752b5 Update Oculus vr configs and add support for accessing Oculus OpenXR runtime 2021-08-27 11:16:20 -07:00
Fredia Huya-Kouadio 3baf5563e8
Delegate handling and implementation of the restart functionality to the Godot host.
(cherry picked from commit f4222733ca)
2021-08-18 23:21:13 +02:00
Rémi Verschelde 2ab45474fd
Merge pull request #51783 from m4gr3d/address_external_dir_access
Fix possible null pointer exception.
2021-08-17 13:32:33 +02:00
ne0fhyk e2bcdad43b Fix possible null pointer exception. 2021-08-16 23:14:10 -07:00
ModProg 1d63a94d19 [android] Fixed wrong button mask for right click 2021-08-16 18:41:20 +02:00
Rémi Verschelde daf922fa8a
Android: Increase default armv7 NDK platform to 19
Following #50359 this is the new minSdk that we target.
Users can still override it in custom builds if they want to support SDK 18.
2021-08-16 10:14:03 +02:00
Rémi Verschelde 028a2a7205
Merge pull request #50359 from m4gr3d/address_external_dir_access
[3.x] Add support for Android scoped storage
2021-08-16 09:48:34 +02:00
ne0fhyk c88d1608ab Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-13 11:04:17 -07:00
Rémi Verschelde b484956fba
Merge pull request #51601 from RandomShaper/android_step_acq_rel
Use SafeNumeric for Android JNI step
2021-08-13 09:33:20 +02:00
Rémi Verschelde f976cec536
Merge pull request #51584 from m4gr3d/investigate_godot_resume_stalls_3_x
[3.x] Resolve issue where the Godot app remains stuck when resuming.
2021-08-13 08:44:33 +02:00
Fredia Huya-Kouadio 336c630f51 Add support for prompting the user to retain app data on uninstall.
Supported on Android 10 and higher.
2021-08-12 22:06:13 -07:00
Fredia Huya-Kouadio 874aa1708f Resolve issue where the Godot app remains stuck when resuming.
This was caused by the fact that a new instance of Godot was created at resume while a previous instance already existed.
The previous instance would then go through its cleanup lifecycle, and would thus attempt to close the entire app, leading to the system to restart the app, thus starting the cycle anew.
The fix involves reusing the previous instance of Godot if one is available instead of creating a new one, as well as giving control to the host activity for how the process should be terminated.
2021-08-12 20:58:00 -07:00
Pedro J. Estébanez 78d945e7fb Use SafeNumeric for Android JNI step
Aside from the cosmetic improvement of using the Godot-style type, this switches to acquire-release semantics, which may improve performance by not forcing a full barrier to be issued if the CPU architecture can use a cheaper one.
2021-08-13 02:48:58 +02:00
Pedro J. Estébanez 45c2a7159e Switch to input buffering on Android
Key, touch and joystick events will be passed directly from the UI thread to Godot, so they can benefit from agile input flushing.

As another consequence of this new way of passing events, less Java object are created at runtime (`Runnable`), which is good since the garbage collector needs to run less.

`AndroidInputHandler` is introduced to have a smaller cross-thread surface. `main_loop_request_go_back()` is removed in favor just inline calling `notification()` on the `MainLoop` at the most caller's convenience.

Lastly, `get_mouse_position()` and `get_mouse_button_state()` now just call through `InputDefault` to avoid the need of sync of mouse data tracked on the UI thread.
2021-08-08 13:41:27 +02:00
Haoyu Qiu 55b52341d1 Make progress and errors translatable when exporting to Android 2021-08-01 17:15:56 +08:00
Fredia Huya-Kouadio df1ebbb0aa Fix custom build export 2021-07-27 12:24:44 -07:00
ne0fhyk d1fdb60ee2 Disable resource optimizations for release builds as it breaks the legacy build system. 2021-07-20 16:36:00 -07:00
reduz ca223d71d8
Addes ability to load build sources from file.
* If not present, the dialog asks to load build sources from a file.
* The export templates check now also verifies that build sources are installed and skips the template check.

This makes Android development easier.

(cherry picked from commit 6639cc9853)
2021-07-20 13:05:10 +02:00
Rémi Verschelde 46c68c0fb9
Android: Fix truncated `application` attributes after #50028 cherry-pick
The `android:icon` attribute is expected to be the last one in the application
definition, as documented by the comment. cd64bcd missed that and caused some
arguments to be truncated.

Fixes #50224.
2021-07-07 00:49:07 +02:00
Rémi Verschelde 3d16bfcc40
Android: Fix syntax error in #50227 2021-07-07 00:08:59 +02:00
Rémi Verschelde 7c8cc037ad
Merge pull request #50221 from madmiraal/fix-50125-3.x
[3.x] Queue the calls to GodotLib.key when Android virtual done is pressed
2021-07-06 23:46:36 +02:00
Rémi Verschelde 8c5c79e020
Android: Fix `xr_mode_metadata_name` removal after cd64bcdae
I had lost that line when resolving merge conflicts.
2021-07-06 23:24:54 +02:00
Marcel Admiraal 2bd3cc0e16 Queue the calls to GodotLib.key when Android virtual done is pressed 2021-07-06 17:54:14 +01:00
Marcel Admiraal d40f73e3a4 Remove Android onKeyMultiple override 2021-07-06 17:37:53 +01:00
Rémi Verschelde 009aa63a57
Merge pull request #50108 from madmiraal/android-use-lambdas-3.x
[3.x] Replace single method anonymous classes with lambdas in Godot Java code
2021-07-06 18:10:45 +02:00
Marcel Admiraal 4b03e05573
Use static inner classes in Godot Java code
(cherry picked from commit 23e152040b)
2021-07-06 11:20:42 +02:00
Marcel Admiraal ab1162e918
Remove redundant explicit types in Godot Java code
(cherry picked from commit 3f95bbed73)
2021-07-06 11:10:46 +02:00
Marcel Admiraal 6a07253bb6
Use StringBuilder instead StringBuffer in Godot Java code
(cherry picked from commit 61ee51d2bf)
2021-07-06 11:10:46 +02:00
Marcel Admiraal c1abbfb605
Fix raw use of parameterized Class
(cherry picked from commit d237f7d33d)
2021-07-06 11:10:46 +02:00
Marcel Admiraal 01ecec451c
Use Java array declarations not C-style declarations in Android Java code
(cherry picked from commit 721b3d56c5)
2021-07-06 11:10:46 +02:00
Marcel Admiraal 2b78d618f4
Remove unnecessary semicolons from Android Java code
(cherry picked from commit 360447001d)
2021-07-06 11:10:45 +02:00
Rémi Verschelde cd64bcdae5
Android: Add `isGame` application attribute, default to true
It can be turned off in the export preset with `package/classify_as_game`.

Upstream definition: https://developer.android.com/guide/topics/manifest/application-element#isGame

> `android:isGame`
>
> Whether or not the application is a game. The system may group together
> applications classifed as games or display them separately from other
> applications.

Also fixes replacing `android:allowBackup` in custom builds.

(cherry picked from commit 40a594c6ea)
2021-07-06 11:10:45 +02:00
Marcel Admiraal 76c1a0e91d
Fix unchecked call to put() warning in GodotInputHandler.java
(cherry picked from commit 8270e101a7)
2021-07-06 11:10:44 +02:00
Marcel Admiraal 4108dd0145 Replace single method anonymous classes with lambdas in Godot Java code 2021-07-03 05:13:08 +01:00
Marcel Admiraal 1ed89353b0 Remove unused imports from Android Java code 2021-07-02 14:41:57 +01:00
Marcel Admiraal 96e56af9b9 Remove redundant interface modifiers from Android Java code 2021-07-02 09:41:09 +01:00
Rémi Verschelde 7e934e31f4
Merge pull request #49912 from madmiraal/fix-49878-3.x
[3.x] Add GDNative libraries to Android custom Gradle builds
2021-06-29 14:58:45 +02:00
ne0fhyk c952201d97
Update config versions and deprecate the use of the jcenter maven repo.
(cherry picked from commit d1a9363c4c)
2021-06-29 14:02:22 +02:00
Marcel Admiraal 42c9fefcca
Add adb output to error message when install fails
(cherry picked from commit de2acbd495)
2021-06-29 13:13:29 +02:00
Marcel Admiraal e021cab45b Add GDNative libraries to Android custom Gradle builds 2021-06-29 09:22:08 +01:00
Rémi Verschelde c045219869
Merge pull request #49804 from m4gr3d/add_support_for_custom_debug_keystore
[3.x] Add support for custom debug keystore
2021-06-23 15:28:40 +02:00