Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Godot Android architecture #76821

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

m4gr3d
Copy link
Contributor

@m4gr3d m4gr3d commented May 8, 2023

This PR sets the building blocks for a clean-up and re-architecture for the Godot Android platform integration.

The current architecture ties the Godot.java entry point to an Android Fragment component.
This is an improvement over the previous architecture where it was tied to an Android Activity component as it enables us to composite UI rendered by Godot with UI rendered by other frameworks. However this also limits the use of Godot on Android to Fragment-based apps, limits control over Godot's lifecycle since it's coupled to the Fragment's lifecycle, and limits usage of Godot on Android to a single window (Godot 4 supports multiple windows).

This PR starts by decoupling the Godot.java entry point from the Android Fragment component. A GodotFragment component is introduced to replicate the previous tied-to-Fragment lifecycle behavior and enable continuity for apps (including our own Godot Android Editor) that relies on that capability.

The changes should be transparent to Godot Android apps and games generated from the Godot Editor, and as such it targets Godot 4.1, so we can validate the new architecture and address any issues.
The work will continue in Godot 4.2 where we'll leverage the new capabilities offered by the architecture to enable support for multiple windows on Android and accelerate startup times for Godot apps and games on Android by leveraging Android Services to preload and prewarm the Godot Engine.

@m4gr3d m4gr3d added this to the 4.x milestone May 8, 2023
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch from 9c4482c to c3cf285 Compare May 8, 2023 00:14
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 6 times, most recently from b845ba2 to 12adf29 Compare May 10, 2023 09:22
@m4gr3d m4gr3d modified the milestones: 4.x, 4.1 May 10, 2023
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 2 times, most recently from a0a54e2 to 0651104 Compare May 10, 2023 18:23
@m4gr3d m4gr3d marked this pull request as ready for review May 10, 2023 19:33
@m4gr3d m4gr3d requested a review from a team as a code owner May 10, 2023 19:33
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 4 times, most recently from 2082aa0 to 2b2fd95 Compare May 19, 2023 08:02
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 7 times, most recently from dbf85bf to 7e6aaee Compare May 24, 2023 22:42
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 2 times, most recently from 7cfbbc0 to 585d1f4 Compare May 30, 2023 14:45
@m4gr3d m4gr3d modified the milestones: 4.1, 4.2 Jun 6, 2023
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 4 times, most recently from 67cfefe to d9fe1c5 Compare June 12, 2023 15:26
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 3 times, most recently from aaa26aa to 2b3bac0 Compare June 19, 2023 17:52
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch from 2b3bac0 to c2484a3 Compare July 1, 2023 15:24
@m4gr3d m4gr3d marked this pull request as ready for review July 7, 2023 15:49
@m4gr3d m4gr3d requested review from a team as code owners July 7, 2023 15:49
@m4gr3d m4gr3d changed the title [WIP] Refactor Godot Android architecture Refactor Godot Android architecture Jul 7, 2023
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch 2 times, most recently from 704eedf to 8a53c59 Compare July 7, 2023 15:52
m4gr3d added 2 commits July 16, 2023 18:56
Decouples the Godot java entry point from the Android Fragment component. This enables the Godot component to be more easily reused across different types of Android components including Activities and Services.
@m4gr3d m4gr3d force-pushed the prototype_godot_service_main branch from 8a53c59 to 29bbc17 Compare July 17, 2023 01:57
@YuriSizov YuriSizov merged commit 57919be into godotengine:master Jul 17, 2023
@YuriSizov
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants