-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Mono/C# support on Android #20267
Comments
I know @hpvb on discord said he'd be looking into the android stuff. Maybe he can chim in some. |
This applies to iOS too but I'll just post this here for now since we'd likely focus on Android first. The only framework I'm aware of for creating mobile apps using Mono/C# is Xamarin. Unfortunately, these tools are not available for Linux, which is problematic for if we want to make use of them since Godot is a strongly multiplatform game engine. I submitted a feature request here: mono/monodevelop#5228 For Android specifically, I also found this https://github.com/xamarin/xamarin-android We may be able to use Mono separately from Xamarin on Android and iOS, but it would still be good to have Xamarin working on Linux, to ensure that the underlying tech (Mono) works properly. |
Well, isn't Godot itself a framework for creating mobile apps using Mono/C# already? We can build Windows apps from Linux with Godot + Mono (i.e. the Linux-compiled C# assemblies work on Windows), so it should work the same for Android, no? IINM, we just need to find how to include the assemblies in the APK and load them from there - and of course compile the Android export templates with the Mono module, but that shouldn't be hard. (I might miss something specific to non-desktop platforms that would require us to go through a thirdparty framework though). |
Since #19839 is closed, forwarding my question. |
I will talk about this once 3.1 stable is out. |
Although all the official documentation I'm reading on the subject says that |
We will be happy to make sure that we can produce Xamarin.Android packages from our CI that are suitable for your consumption. We are trying to setup a communications channel between the Godot folks and my team to make sure we are not blocking you. While you can certainly produce Android packages natively, I would love to see this use Xamarin.Android, mostly because we productize the latter and can provide support to any users that are running into problems. And it would be the same on Windows, Mac and Linux. But most importantly, because then your C# users could call and consume any native APIs from Android without having to use some sort of module, they can access the entire Android API from C# when they so desire. |
This might be a dumb question, but how exactly is this going to work in terms of exporting? Right now, a "hello world" Godot project for Windows clocks in at around 28MB; I just tried a "hello world" Godot/Mono project, and it clocks in at around 42MB. That's quite large, considering there are no game assets in it yet. When Android works with C#, is this going to be the same, or is there some sort of DCE/compression/something that will be applied to shrink the APK size down? |
I haven't used it in Godot before, but I believe you'll just have to tick the Apk Expansion flag in the export dialog and you'll be able to have an expansion file. Expansion files can be up to 2GB in size. If a person is using C# it might be because they'll be developing a larger game anyway, so a bigger APK file isn't really a big deal. |
With that said, I just made an empty Unity build and the APK size was only 16.3 MB and 11 MB with stripping on at the highest setting, so I'm sure there's some sort of stripping and/or compression that can be done :) |
APKs are already compressed since they're just ZIP archives (unless you tweak ZIP creation parameters to disable compression, that is). Likewise, desktop games' distributions will likely be compressed somehow (in a ZIP archive or Windows installer, by Steam, …). |
@NathanWarden thanks, that's promising. I'm not using C# because I'm making a larger game - I'm using it because I'm much more proficient in it (and I can make much more testable games with it). Hopefully this will work out well, I'll wait for the appropriate release. I know with .NET Core applications, a "hello world" release app is like 60MB; you can use Mono's dead-code compression thing (the name eludes me just now - the one endorsed by Scott Hanselman) to shrink it to around 40MB. If you zip all the files, it shrinks even further. Maybe Godot will adopt some of these tools/techniques. |
We lacked an issue to keep track of Android export support for Mono/C# projects, so here's one.
@neikeq What are the needed steps to get this to work?
The text was updated successfully, but these errors were encountered: