App name in settings

Put your problem here if it does not fit any of the other categories.

App name in settings

Postby iaindownie » Sun Feb 20, 2011 11:48 am

Hi,

on my phone, when I go into Settings > Applications > Manage applications, my development app is called the full package name (e.g. bto.android.myapp, or com.example.test.myapp), while others are labelled by their single app name (e.g. Dolphin).

Is there any way to set the application list to render the more helpful name of the application (e.g. My App)? Might it be in the Manifest?

Thanks
User avatar
iaindownie
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon Dec 29, 2008 4:08 pm
Location: Thetford, Norfolk, UK

Top

Re: App name in settings

Postby blundell » Sun Feb 20, 2011 11:37 pm

Do you have this in your manifest:

Code: Select all
<application ... android:label="BLAH BLAH NAME IN MENUS" ...>


Also sometimes in that list, it will show the apps by package name and then when it finishes loading it will change it to the app name.

It can also show the package name if you have installed the app, moved it to your SD card, formatted your SD card without uninstalling the app.

:-)
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: App name in settings

Postby iaindownie » Mon Feb 21, 2011 5:10 pm

Great! I have
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. android:label="@string/app_name"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

and app_name is used in the strings.xml file.

I must have been too impatient and need to wait for all to load to see the real label render correctly.

Many thanks!
Iain
User avatar
iaindownie
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon Dec 29, 2008 4:08 pm
Location: Thetford, Norfolk, UK

Re: App name in settings

Postby iaindownie » Tue Feb 22, 2011 10:21 am

Unfortunately, even with this setting for android:label, and leaving the list of applications to settle, it still shows and the full package name. Not a big deal as the app displays normally in the Home page etc., just a bit annoying since I can't work out the problem.

Iain
User avatar
iaindownie
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon Dec 29, 2008 4:08 pm
Location: Thetford, Norfolk, UK

Re: App name in settings

Postby blundell » Tue Feb 22, 2011 11:14 am

Hmm are you sure, can you post your manifest?
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: App name in settings

Postby iaindownie » Tue Feb 22, 2011 11:52 am

Here:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3.         package="bto.android.myapp" android:versionCode="1"
  4.         android:versionName="1.01">
  5.         <application android:icon="@drawable/ic_launcher">
  6.                 <activity android:name=".MainActivity" android:label="@string/app_name"
  7.                 android:screenOrientation="portrait">
  8.                         <intent-filter>
  9.                                 <action android:name="android.intent.action.MAIN" />
  10.                                 <category android:name="android.intent.category.LAUNCHER" />
  11.                         </intent-filter>
  12.                 </activity>
  13.                 <uses-library android:name="com.google.android.maps" />
  14.         </application>
  15.         <uses-permission android:name="android.permission.INTERNET" />
  16.         <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  17.         <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  18.         <uses-sdk android:minSdkVersion="8" />
  19. </manifest>
  20.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


And the @string/app_name is calling:

<string name="app_name">My App</string>

from res\values\string.xml

It's only in development at the moment on debug on my phone, but I have other small test apps in debug on the phone which do render correctly in the list of apps in settings.

I hope I am not being really stupid, apologies if you spot an obvious error!

Iain
User avatar
iaindownie
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon Dec 29, 2008 4:08 pm
Location: Thetford, Norfolk, UK

Top

Re: App name in settings

Postby blundell » Tue Feb 22, 2011 12:56 pm

Yeah read my original post :-)

You have your app name on the activity not on the applicaiton.

You need
Code: Select all
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name">


not

Code: Select all
<activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="portrait"> 



(The label on the activity tag is what is shown on the little grey bar at the top of the activity)
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: App name in settings

Postby iaindownie » Tue Feb 22, 2011 1:22 pm

I am stupid, and very humbled! Missed the application reference, just assumed activity, and I must have copy/pasted stupidly somewhere along the way. Thanks Blundell - very helpful.

Best wishes
Iain
User avatar
iaindownie
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon Dec 29, 2008 4:08 pm
Location: Thetford, Norfolk, UK

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 7 guests