Issue
I am creating android apps in Xamarin.forms now. But the apk size of Xamarin apps is more than 90 Mb. So I am planning to switch to the android studio as it is specially designed for android apps. But I have very little knowledge about Java and Kotlin.
I am very familiar with C# because I am coding in Xamarin. Is there any way to use C# instead of java in Android Studio?
Any help would be appreciated.
Solution
Actually we can't. Android Studio supports only Java and Kotlin and we can build apps using C++ but not with any other Languages.
But instead you can reduce your Xamarin App size from 90 MB to less than 15 MB.
Make sure that you set in Release Configuration
You can reduce it by,
Linking all you app's SDK and User Assemblies
Using Code Shrinker (either ProGuard or r8)
Enabling Multi-Dex to improve performance.
Bundle assemblies into native code to improve performance.
AOT Compilation you can try this, but it didn't work for me, this reduces the startup time.
Disable Debugging\
Linking all you app's SDK and User Assemblies will actually reduce your app size upto 70% to 85% depending upon your coding and assets that you have.
If you do good in C# then Java could be a bit easy as both looks similar and most of the functions and method are same (If you build apps in Xamarin.droid). Even I too switched from Visual Studio 2019 making apps using Xamarin to Android Studio using Java. At starting as usual feels somewhat difficult but then it will be very familiar. It just takes 1 or 2 weeks to get the basics done with Java if you know C#. This is from my Experience.
Answered By - Viknesh TPK
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.