android - Difference between android:name and android:label

Viewed 1329

I am flutter developer and some Android settings confuses me.

What is the difference between android:label and android:name in AndroidManifest.xml??

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="flutterapp2"
        android:icon="@mipmap/ic_launcher">
5 Answers

The

android:name="io.flutter.app.FlutterApplication"

is a default to a Flutter application & you should NOT edit this anyway (unless you created a class that extends FlutterApplication class).

The android:label is to define your app name, which is display in the installed application list.

If you want to change the app name in home screen, check android:label inside the <activity /> tag

For more information, check out the official documentation: https://developer.android.com/guide/topics/manifest/application-element

android:name The fully qualified name of an Application subclass implemented for the application. When the application process is started, this class is instantiated before any of the application's components. The subclass is optional; most applications won't need one. In the absence of a subclass, Android uses an instance of the base Application class.

android:label A user-readable label for the application as a whole, and a default label for each of the application's components. See the individual label attributes for , , , , and elements. The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.

According to https://developer.android.com/guide/topics/manifest/application-element

android:name

The fully qualified name of an Application subclass implemented for the application. When the application process is started, this class is instantiated before any of the application's components.

The subclass is optional; most applications won't need one. In the absence of a subclass, Android uses an instance of the base Application class.

android:label

A user-readable label for the application as a whole, and a default label for each of the application's components. See the individual label attributes for , , , , and elements.

The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.

android:name this is a class which will wxecute first time (this is not your app name ,this is a functional thing) and android:label this is name of app shown on icon which represent the app name

android name is the name of the package that you are defining for that project and android label is the default name for your application

The android documentation states the following and you may find the list of attributes here

android:name The fully qualified name of an Application subclass implemented for the application. When the application process is started, this class is instantiated before any of the application's components. The subclass is optional; most applications won't need one. In the absence of a subclass, Android uses an instance of the base Application class.

android:label A user-readable label for the application as a whole, and a default label for each of the application's components. See the individual label attributes for , , , , and elements. The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.

Related