Xamarin.Forms change android app name
I created a very basic Xamarin.Forms app.
I have checked Android and iOS targets. I have 3 projects:
- General project
- IOS specific project
- And a specific project Droid.
The Android dedicated app has a ".Droid" suffix in the app name.
So iIdecided to right click on the droid project and remove that suffix in the Build Name field.
I have an exception where I run my application (on startup). If I change the Assembly name again to fit the droid suffix, it no longer works. You can try this with an empty project with the latest Xamarin.Forms.
I do not understand why.
thank
I am working on Visual Studio for Mac - Xamarin.Forms
The problem is that you are changing the assembly name of your application, not the name.
If you want to change the name of the app in Xamarin.Forms Android
, you have two options:
- Go to
MainActivity
and change the propertyLabel
:
- Or remove
Label
MainActivity
and add the name inManifest.xml
via UI or code:
On iOS, you have to change it to Info.plist
.
The above answer works great. But I am adding more details.
The application name is fetched from the AndroidManifest.xml file , which in turn refers to Values> Strings.xml . Do not include the name of the hardcoded application here. Its good practice to separate all strings used in the Strings.xml file.
The Label property overrides this value and sets the app title, apk name to the Label value set inside MainActivity.
It is preferable to remove the label value from MainActivity.cs and change the value in Strings.xml to be global and consistent.