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

Godot Subview Architecture - Android #1064

Closed
m4gr3d opened this issue Jun 15, 2020 · 5 comments
Closed

Godot Subview Architecture - Android #1064

m4gr3d opened this issue Jun 15, 2020 · 5 comments

Comments

@m4gr3d
Copy link

m4gr3d commented Jun 15, 2020

Describe the project you are working on:
Enable the ability to embed Godot as a subview within an Android application.

Describe the problem or limitation you are having in your project:
As of version 3.2.2, the Godot Android architecture is based off the Android FragmentActivity component. Since an Android application typically only has a single Activity active at a time (especially since ActivityGroup was deprecated), with the Activity's view driving the entire screen display , this results in the inability to embed Godot as a subcomponent within an Android application.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
The goal of this proposal is to update the Godot Android architecture to support using Godot as a subcomponent.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
The entry point for Godot apps on Android is the Godot.java class. The class extends FragmentActivity in order to hook into the Activity lifecycle which enables to update the app's screen display via setContentView and propagate key lifecycle callbacks to the Godot Engine.

As such, we need an alternative that provides the ability to update the screen's display while also providing the Godot Engine with the expected Android lifecycle callbacks, and that is modular and can be combined with other components in a single activity.
Based on these requirements, Android Fragments appear to be the best tool for the job, and will be used as the basis for this work.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
This affects the architecture for Godot Android apps, and thus cannot be worked around via scripting logic.

Is there a reason why this should be core and not an add-on in the asset library?:
This affects the architecture for Godot Android apps, and thus cannot be provided via scripts and/or plugins.

@Calinou
Copy link
Member

Calinou commented Jul 3, 2020

This was implemented by godotengine/godot#39855, closing.

@SilvanaP
Copy link

Is the usage of this awesome feature documented somewhere? :-D

@madhawa-se
Copy link

@SilvanaP Did you find a way to do it ?

@SilvanaP
Copy link

SilvanaP commented Sep 3, 2021

@SilvanaP Did you find a way to do it ?

No, unfortunately not :-/

@m4gr3d
Copy link
Author

m4gr3d commented Dec 15, 2021

@SilvanaP @madhawa-se Apologies for the delay. We'll be expanding Android related documentation, including the use of this feature in the coming weeks.
You can track the progress via godotengine/godot-docs#4018.

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

No branches or pull requests

4 participants