290 Commits

Author SHA1 Message Date
2abf2a6622 Check if vibration duration is > 0 on Android
(cherry picked from commit 47f338fc12)
2021-09-29 08:57:24 +02:00
a9bffd5878 Fix possible null pointer exception.
(cherry picked from commit e2bcdad43b)
2021-08-18 23:27:30 +02:00
2eb8875b77 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.

(cherry picked from commit c88d1608ab)
2021-08-16 09:56:32 +02:00
1c8682aa78 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.

(cherry picked from commit 874aa1708f)
2021-08-13 12:17:15 +02:00
037a1d4f69 Disable resource optimizations for release builds as it breaks the legacy build system.
(cherry picked from commit d1fdb60ee2)
2021-07-24 01:09:35 +02:00
54eef268c0 Fix unchecked call to put() warning in GodotInputHandler.java
(cherry picked from commit 8270e101a7)
2021-07-06 16:28:30 +02:00
9933553268 Update config versions and deprecate the use of the jcenter maven repo.
(cherry picked from commit d1a9363c4c)
2021-06-29 14:02:56 +02:00
5ba710863d Add support for custom debug keystore.
(cherry picked from commit d5b4045ea4)
2021-06-29 13:55:03 +02:00
b45fb53896 Update Gradle archiveName and destinationDir properties
(cherry picked from commit 78e791045c)
2021-06-07 22:52:02 +02:00
8dc3d5eb7a [Android] fix generateDevTemplate
(cherry picked from commit 0477256793)
2021-04-30 12:06:39 +02:00
31bc9d859b [Android] Allow to build dev template with symbols
(cherry picked from commit fd7141fc03)
2021-04-30 12:06:34 +02:00
46a5f3a18e Android: Upgrade buildTools from 30.0.1 to 30.0.3
It seems 30.0.1 had issues with compatibility with JDK 8 and 11,
which appear to be solved in 30.0.3 as per godotengine/godot-docs#4796.

(cherry picked from commit d88e1f04df)
2021-04-29 13:06:35 +02:00
bc68872e2d Disable the requestLegacyExternalStorage attribute when there are no storage permissions. 2021-04-16 07:26:24 -07:00
158c848ac5 Fix custom boot splash image scaling. 2021-04-12 16:39:32 -07:00
dedeada310 Fix issue causing the response callback to be invoked with the invalid requestCode. 2021-04-09 13:38:36 -07:00
14e7f6fa7c Fix onMainRequestPermissionsResult callback for Android plugins. 2021-03-17 09:30:19 -07:00
864f4201b9 Enable doNotStrip when doing development/debugging within Android Studio
(cherry picked from commit 4380004176)
2021-03-17 15:17:02 +01:00
94df08aae1 Leverage java annotations to simplify the logic used to register the Godot plugin methods. 2021-03-16 01:20:43 -07:00
c5fb32d594 Update the logic to load Godot Android plugins packaged into the binary.
The previous logic had the side effect of imposing a limit of one plugin per `aar` binary. The update lifts that restriction.
2021-02-26 09:09:40 -08:00
65eb5fdf1e Update the initialization timeline for the Godot fragment to be more consistent with the previous activity based timeline.
(cherry picked from commit 3ce7678374)
2021-02-25 15:14:32 +01:00
9fb5215db5 Add logic to record the version of the Godot engine for the Android platform.
(cherry picked from commit bc5120eb97)
2021-02-25 15:14:32 +01:00
ef9d945e16 Disable engine splash logic on Android; this is now handled by the Android theme api.
In addition, add support for scaling and applying filter to the splash screen on Android.
One limitation of the api being used is that the splash screen aspect ratio is not maintained when it's scaled up.
2021-02-18 03:17:58 -08:00
96a3f01ac5 Add missing ndkVersion to the library gradle build config.
(cherry picked from commit 9418197081)
2021-02-18 10:37:59 +01:00
1557bc8396 Revert AGP to version 4.0.1 as a workaround to https://issuetracker.google.com/issues/171235570 in version 4.1.x
(cherry picked from commit e5311f3523)
2021-02-18 10:37:28 +01:00
48b73e4532 Android: Bump NDK version to 21.4.7075529
This is what GitHub Actions now provide and they removed the previous 21.3.6528147.
A bit annoying to have our hand forced this way but it's still 21.x so should be good
to upgrade.

(cherry picked from commit c730da8b20)
2021-02-18 00:36:46 +01:00
64f5a7b8ca Expose GodotPlugin's utility methods used for registration and signal emitting.
This enables creation and use of a plugin like class by composition rather than inheritance.
2021-02-15 15:57:36 -08:00
8777282c40 Fix joystick axis mapping issues with NVIDIA shield. Probably others.
Issues addressed:

a) Axis mappings were including virtual mouse axes on NVIDIA Shield TV.

The virtual mouse axes have the same axis numbers as the normal analog stick numbers. This was completely breaking joypad support on NVIDIA Shield TV.

b) Joypads were being tracked in a List with the index in the list being treated as the Godot device id.

If a device were to be removed, any device later in the list would be shifted, potentially causing future events with the shifted joypads to have incorrect IDs according to the Godot engine.

c) Unnecessary events were being sent to the Godot engine.

A check was added (per Joystick) that will prevent sending events for all axes when only a single axis value changed.
A similar check was added for "HATs".

See #45712
2021-02-09 08:33:42 -05:00
5886d09521 Improve the logic to compile for Android by automatically detecting and setting up the Android NDK if needed.
(cherry picked from commit eee213e01a)
2021-02-05 13:29:02 +01:00
56535539d4 add search extensions for scons' path
(cherry picked from commit befbfecd4d)
2021-02-02 13:02:47 +01:00
49646383f1 Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
188609e5ab CI: Update to clang-format 11 and apply ternary operator changes
(cherry picked from commit af878716f2)
2021-01-13 16:14:35 +01:00
cbda02991f fix android wrong multi-touch pointerid 2020-11-27 16:46:21 +08:00
d13d29240c Update gradle build files to automatically perform signing and zipalign tasks for custom builds. 2020-11-22 17:54:12 -08:00
7a9660e8d2 Change android orientations from sensor to user
# Conflicts:
#	platform/android/java/lib/src/org/godotengine/godot/GodotIO.java

(cherry picked from commit d658063833)
2020-11-17 12:01:59 +01:00
566835e181 Update the logic to query for the 'scons' command executable path.
(cherry picked from commit 46cc3233d8)
2020-11-17 12:01:59 +01:00
92ff6c5164 Implement OS.get_screen_orientation() for Android 2020-11-13 10:14:06 -05:00
8405f1225e [3.2] Android: Keyboard modifier and arrow key support 2020-11-13 15:10:17 +02:00
835d4535b7 Add a separate nativeSrcsConfigs module to handle Android Studio constraints for native code editor support.
(cherry picked from commit edf762fba6)
2020-11-11 15:30:56 +01:00
3b547457d7 Update the gradle plugins
(cherry picked from commit aff7cf4390)
2020-11-11 15:30:55 +01:00
191c84f952 Android: Mouse Implementation
Implement mouse
Move touch to inputManager
Change to use android/input.h
2020-10-30 15:23:29 +02:00
2bec10fd1c Implement OS.get_window_safe_area() for Android 2020-10-27 11:52:20 -04:00
91a1e4c9ee Fix splash screen loading on Android 2020-09-28 11:24:02 -07:00
fc50d5b38c Merge pull request #42186 from m4gr3d/3.2-android-subview
[3.2] Godot Android Subview Implementation
2020-09-27 20:05:33 +02:00
8d9733f90c Add overridable init method for the Godot fragment instance. 2020-09-18 16:45:46 -07:00
e99dc65b64 Enable the ability to use Godot as a subview within an Android app
(cherry picked from commit 920639511d)
2020-09-18 16:45:40 -07:00
59da1db188 Add 'Export App Bundle' to Android Export Options 2020-09-18 16:38:30 -07:00
452af201b0 Write an AndroidManifest.xml file to be merged with app module's manifest. 2020-09-18 16:17:31 -07:00
ee9127bd20 Create strings.xml files to mimic behavior of _fix_resources method 2020-09-18 16:17:27 -07:00
a8240f7351 Fix issue causing the textedit to move upward 2020-08-18 17:05:23 -07:00
5972495d99 Revert "Virtual keyboard size adjustment fixes"
Also reverts "[3.2] Move PopupWindow logic to GodotEditText on Android".

This reverts commits 69db38742f and.
ff0ada164b.
2020-08-14 00:32:04 +02:00