-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Re-architecture of the Godot Android plugin. #33682
Re-architecture of the Godot Android plugin. #33682
Conversation
49ec3a1
to
6829764
Compare
fc373c4
to
0da2da7
Compare
f0547e6
to
382a2e9
Compare
@akien-mga @BastiaanOlij @godotengine/android PR is ready for feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works as advertised I think its a great step forward. But not being super experienced with Android I'll have to take your word for it :)
This may solve the deploy issues for ARCore as well, might need to think of exposing a part of the camera server through GDNative first.
How is this working in conjunction with GDNatives config? Right now GDNative will do the work in making sure the plugin is added to the project correctly, is that still the case here or does someone need to manually perform extra actions?
@BastiaanOlij can you point to the GDNative logic that setups the plugin for the project so I can validate. |
48784ef
to
d285659
Compare
@akien-mga This PR is ready on my side, so it should be ready for merging into the |
569ee84
to
3a9465c
Compare
1b7d06e
to
8289c50
Compare
CC'ing some community members who maintain Android plugins:
If you can, please provide feedback on this proposal, which would require porting plugins to a new system again (sorry!) but should hopefully be much cleaner and correct for the Android ecosystem. This PR is for 4.0, but there's also a matching PR for 3.2.x: #36336. |
@akien-mga It looks interesting, but I can not find example plugin implementation. Link to oculus mobile plugin seems to be broken. |
@DrMoriarty The proper link is https://github.com/m4gr3d/godot_oculus_mobile/tree/2.0/plugin. I've fixed it in the description also. |
@DrMoriarty I've also migrated the |
1b00b72
to
cfda47e
Compare
One of the great thing about the Godot plugin (v1) was the possibility to the final user to customize their Android manifest file. Will be it possible with v2? |
@akien-mga For 4.0 that sounds reasonable. It's a bit tricky for 3.2.x since depending on how we got about it, there's a chance for the two systems to coexist for a short period of time. In that case, we'd need to differentiate them to both plugin makers and users. The versioning also gives additional flexibility to engine developers for improving the plugin system in the future. If we decide to add new features, we can separate the plugin logic based on the version number, and thus ensure we maintain backward compatibility. So at the very least, while we can remove the version from the documentation, it may be useful to keep it in the internal plugin logic. |
@Shin-NiL Yes that's still possible and it's vastly improved as further customization can be made using the |
@m4gr3d how exactly is it done, where the plugin user will edit it? I don't get it, sorry :( |
I am fine with it if the compatibility breaks. A hard cut is (in my opinion) better than to support different systems. |
@Shin-NiL With the new system, each plugin has its own
If you have an example for the situation you're describing, I can provide an |
@m4gr3d nice, I was talking about the second scenario you mentioned. Thanks for explaning. |
@Shin-NiL I've added a reference Hope that helps! |
@m4gr3d thank you very much. |
@Shin-NiL yep, that's exactly right! The other neat thing is that since a plugin is now just a regular Android library, you can leverage the vast Java and Android ecosystem to build the desired plugin functionality (e.g: ML, opencv, authentication libraries) |
f7509b5
to
fecbd94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a rebase but based on my testing of the 3.2 PR, this seems good to go.
5077a50
to
1bf51e8
Compare
@akien-mga the PR was rebased. |
1bf51e8
to
3a0f737
Compare
3a0f737
to
f097def
Compare
Thanks a lot! |
This PR revisits the Godot Android plugins' architecture.
This is done by leveraging the Android library file format. A Godot Android plugin is now defined as follow:
At runtime, Godot (via
GodotPluginRegistry
) will parse the Android manifest, and retrieve all components with the specified<meta-data>
tag. It'll then use reflection to instantiate and load the plugin class defined byplugin.init.ClassFullName
. From there, the plugins follow the same lifecycle as with the previous architecture.A nice side-effect of this new architecture is that we can remove all the gradle build and android manifest custom update logic, since we can just rely on the Android library build and manifest merge mechanism.
Documentation update: godotengine/godot-docs#2979
Note:
core
. This would however limit ARCore to custom builds only.Example implementation: