Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android:name value in androidmanifest.xml

Although my app name is showing correctly on emulators and real devices, in androidmanifest.xml it currently reads android:name="HelloCordova"

<activity 
    android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" 
    android:label="@string/app_name" android:name="HelloCordova" 
    android:theme="@android:style/Theme.Black.NoTitleBar">

Should I change the HelloCordova to what my app name is or is it ok to leave as-is? Thanks!

like image 482
Sunny Day Avatar asked Feb 14 '23 13:02

Sunny Day


2 Answers

android:label and android:name are completely different.

  • android:label is the name that will show up on emulators and real devices as you've observed.
  • android:name is "An optional name of a class implementing the overall android.app.Application for this package. [string]". This attribute is used when you have a custom class that extends Application that you want to use. This attribute should be a class prepended by its package. You can just use one period to use the application's package.

Example:

android:name="com.myapp.CustomApplication" or android:name=".CustomApplication".

like image 107
James McCracken Avatar answered Feb 23 '23 17:02

James McCracken


HelloCordova here is the name of a class extending Activity in (your) code.

What you see on ActionBar or elsewhere is android:label="@string/app_name", which is (most probably) defined in res/string.xml.

like image 36
MaciejGórski Avatar answered Feb 23 '23 17:02

MaciejGórski