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

+3


source to share


2 answers


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 property Label

    :

enter image description here

  • Or remove Label

    MainActivity

    and add the name in Manifest.xml

    via UI or code:


enter image description here enter image description here


On iOS, you have to change it to Info.plist

.

enter image description here

+7


source


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.

Application name picture



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.

enter image description here

+2


source







All Articles