-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
[WIP] Editor Android Port #36776
[WIP] Editor Android Port #36776
Conversation
@thebestnom Are the changes in this PR able to compile and build a working version of the Godot editor on Android devices? |
@m4gr3d yes it does, im debugging it from android studio on my oneplus 7t (the build.gradle was changed somewhat to support android studio build) |
I think the only reason to make this is for get users attention like "Godot: You can make a game even in your phone" and photo of a guy with his phone making his own game when he's going to work. It's a striking feature. |
I can't see it working on a phone, tbh, due to available screen space limitations, but why not on tablets? |
I personally use my phone and I know a lot of people use their android tablets as laptop, I have a foldable keyboard always on me... And for now the editor works with almost no changes to the code (which is very impressive) Making the last few fixes should not take too much time, and by the issue (which I should've linked) you can see I'm not the only one that thinks that way Edit: linked the original issue in the first comment |
Also the current code state of the port is on the hacky side, it's kind of a POC in some of it, but it shouldn't take too long to make it properly from here (Im talking mostly on the project manager to editor transition) |
@nikhilCad @kuruk-mm given that Android runs on a lot of devices and form factors, this would allow Godot to automatically support them. Also this shows that Godot may also run on iOS with the appropriate modifications, which thanks to Apple pushing the iPad would be a large and interesting platform to support. |
Ios would be hard because it have no way of touching real files, on android I just had to use the normal unixfFieAccesor for res in editor mode |
My original motivation was doing gamedev with Godot for teenagers. Not everybody has access to a PC, but nearly everybody has access to a tablet or smartphone. And being able to create a game and then show it off to your friends on the same device is pretty cool. Also, you can attach keyboards, mice and screens to phones. I don't think you'll be able to do full blown gamedev in the subway but you can definitely work on some last minute changes or try out simple concepts. |
As someone who use python and jupyter notebook on termux on my phone I can say I cab use it for full blown dev That said, android while support mouse it referring as touch, so it will need to be implemented kinda differently (kinda) |
And I'm pretty sure most of us understand why android port should be a thing, so I think we can stop discussing about if we should and start discussing on how to do it the right way? 😄 |
Current my two main problem that I want to implement first are
I heard you are trying to change to NativeActivity, will it change anything about that?
And one small thing, android doesn't support opening file explorer from app so any button that does open in file explorer crashes the app, so I think how to diable those button without too much code (like alerting in the godotio.java file instead of trying to open it) |
@thebestnom It's unlikely we'll go down that path given there are several (present and upcoming) Godot features that are made vastly simpler by using the regular Android activity.
Android support mice so the logic will have to be able to distinguish between mouse input, in which case double click can be used, and touch input for which single click should be used to select and open items in the editor. @thebestnom @akien-mga Would InputMap be useful here to abstract the action from the actual input event?
That doesn't sound right. Can you provide the stacktrace for the crash. You should in theory be able to open any Android apps from another Android app. |
While android support mouse, by my testing and docs it counts as touch with special properties (I would like to be wrong here) InputMap and implementing (in a different pr) mouse inputs for android, would be interesting though For the crash I would sent you later today, it mostly write that the app tries to get out of it's restrictions |
error: android.os.FileUriExposedException: file:///storage/emulated/0/Download/New Game Project exposed beyond app through Intent.getData() what I think we can do is set type to resource/directory maybe that will help, but I"m not sure |
Of course, read the main comment, |
Cool! I wish i had an android tablet to test this on.. |
I use and develop it for my phone... So with a mouse and keyboard it's surprisingly pretty comfortable (even though currently most mouse event doesn't work on android 😅) |
I'm interested in a Android port of Godot. |
As I said last time 😅 |
Great! Few questions, |
Np |
Thanks, I realized the download link was in the pr right after I posted those questions, from what I see looking at some of the previous posts that it might be backported to 3.x, is that still in the plans? |
Well, 3.x port shouldn't be too hard as this started as 3.x editor, but it will take some changes 😄 |
Okay, thanks for answering my questions, can't wait to be able to try using Godot on my tablet! |
Do you plan release a armv7l build for the 32 bit devices? |
42d5ba0
to
82e315d
Compare
fix execute use shouldNotStrip for deciding to strip symbol fix intent fix running with create_process and merge redundent godotGame and godotEditor
82e315d
to
750a895
Compare
I need to start compile it with all build type😅 |
platform/android/java/editor/src/org/godotengine/editor/GodotProjects.java
Show resolved
Hide resolved
@@ -17,3 +17,5 @@ target_include_directories(${PROJECT_NAME} | |||
SYSTEM PUBLIC | |||
${GODOT_ROOT_DIR} | |||
${GODOT_ROOT_DIR}/modules/gdnative/include) | |||
|
|||
add_definitions(-DUNIX_ENABLED -DVULKAN_ENABLED -DTOOLS_ENABLED) |
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.
Allowing Android Studio to correctly show #define
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.
Good find. May be worth adding those separately in a small PR so we can all benefit!
I'm having an issue on my Samsung S21. When I run the game I cannot return to the editor main screen. When I press the back button the entire app closes. Screen_Recording_20220117-105934_World.Launcher.mp4 |
Yep a known bug 😅 |
I tried it again with prebuilt "android_editor_release_debug_2022_01_11.apk" and still get a black screen. Maybe it's an issue with the new mobile vulkan backend and not this pr? |
@@ -17,3 +17,5 @@ target_include_directories(${PROJECT_NAME} | |||
SYSTEM PUBLIC | |||
${GODOT_ROOT_DIR} | |||
${GODOT_ROOT_DIR}/modules/gdnative/include) | |||
|
|||
add_definitions(-DUNIX_ENABLED -DVULKAN_ENABLED -DTOOLS_ENABLED) |
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.
Good find. May be worth adding those separately in a small PR so we can all benefit!
@LinuxUserGD @likeich @filipworksdev @The-Sapphire-Starship @CAPTAIN1947 There's a |
So I tested it on my low end 10.1 inch 32 bit tablet. And as I hadn't expected, its working quite fine. The controls are ok with an external mouse and keyboard. There are a few issues here and there but overall its working. I tried some of the examples and they are also working good without any massive lag.
|
@CAPTAIN1947 Thanks for the feedback!! I've created godotengine/godot-proposals#3931 in order to centralize the discussion / feedback / suggestions regarding this work. |
Superseded by #58160. |
with the headstart of @fahrstuhl and my stubbornness android port is starting to look like it getting somewhere
Issue discussing this feature #267
Proposal for this feature: godotengine/godot-proposals#3931
currently in wip because
no sign
to gradle build task and will not build with toolsBuild instruction #36776 (comment)
Android Editor apk if you want to test it for yourself (arm64v8)
EDIT: replaced apk with release_debug version, with directory bug fixed
EDIT2: recompiled over newer master commit (5d880bf)
EDIT3: uploaded a new version and now link set to build folder where I will upload newer versions instead of editing the link everytime