Why is my Android app name same as the launcher activity name? - android

I understand that android:label= decides the name of the app.
I have done it properly as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.drsystem"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.drsystem.LoginActivity"
android:label="#string/title_activity_login" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.drsystem.CalibrationActivity"
android:label="#string/title_activity_calibration" >
</activity>
<activity
android:name="com.example.drsystem.DeadReckoningActivity"
android:label="#string/title_activity_dead_reckoning" >
</activity>
</application>
</manifest>
But my app name appears beneath the icon on the screen is still "#string/title_activity_login"
I want it to be "#string/app_name"
Anyone can help?
Thanks in advance

It's not really weird, but just good to know :
the Android's launcher use the Intent Launcher Label or if not set, the activity's label and finally application's label
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Naming my application in android
This is a bit weird in android...
App name is pretty much determined by first activity label.. or application label if it isn't set.

Just remove this line
android:label="#string/title_activity_login" from the Manifest file

Related

Android application crashing, manifest issue

Heloo! I am creating an application in Android. I have declared all my activities in Android manifest, including the main one, and when i start it, it says that the activity i have selected as launcher does not exist:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.boacterapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="MainPage"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="AboutPage"
android:label="title_firskljt_activity">
</activity>
<activity
android:name="RecentSightingsPage"
android:label="title_first_activity">
</activity>
</application>
</manifest>
I have been stuck here for a while, so i'm kindly asking that you could help me identity if i have a problem in my manifest. Thank you in advance!
Make sure MainPage activity is in package "com.example.boacterapp".
Another option: replace short name:
android:theme="#style/AppTheme" >
<activity
android:name="MainPage" <----------------- short
android:label="#string/app_name" >
<intent-filter>
With long name that makes up the full class name of your activity:
android:theme="#style/AppTheme" >
<activity
android:name="com.bla.bla.MainPage" <------------- long
android:label="#string/app_name" >
<intent-filter>
Add "." (dot) before MainPage
as
android:name=".MainPage"
Same for others,so rewrite your manifest as
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.boacterapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainPage"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AboutPage"
android:label="title_firskljt_activity">
</activity>
<activity
android:name=".RecentSightingsPage"
android:label="title_first_activity">
</activity>
</application>
</manifest>
<activity android:name="MainPage"
should be:
<activity android:name=".MainPage"
assuming that your MainPage activity is in the package com.example.boacterapp. If not, you need to provide the fully-qualified name of the MainPage app.
Activity name should have dot prefix, change activity name to .MainPage. Make sure it is inside com.example.boacterapp package

Application icon doesn't appear when I uninstall my app

I dont know a lot of English, but I have a big problem. I install my application and I can see the application icon when I look for it, but when I go to the uninstall menu, or in the notification bar, the icon doesnt appear.
Here are some photos of that problem.
https://www.dropbox.com/s/h80w3ztp9ex36rw/2013-12-09%2020.56.03.png
https://www.dropbox.com/s/v69il8ai5oinkvm/2013-12-09%2000.44.58.png
I can write my AndroidManifest, it's this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Podometro"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.Podometro.HiScreen"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.Podometro.Pedometer"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:exported="true"
>
</activity>
<activity android:name="com.Podometro.CrearArchivo"
android:screenOrientation="portrait"> </activity>
<activity android:name="com.Podometro.Twitear"
android:screenOrientation="portrait"> </activity>
<activity android:name="com.Podometro.TwitterWebActivity"
android:screenOrientation="portrait"> </activity>
<activity android:name="com.Podometro.Constants_Settings" > </activity>
<service android:enabled="true"
android:name="com.Podometro.TheService">
</service>
</application>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
Thanks for your help.
I'm not sure what is that uninstaller but I'd make sure to check it doesn't happen with other applications too.
Also verify you've got a version of your icon for all standard size versions. (drawable, drawable-hdpi, drawable-ldpi, etc.)
Buena suerte ;)

Application package 'AndroidManifest.xml' must have a minimum of 2 segments

I read this:
Error in AndroidManifest.xml "must have a minimum of 2 segments" but there is no solution.
Its happen after I change the name of the project by refactor->rename (instead com.example.my app to myapp only) and after that I change the name also in the manifest.
Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="save_money"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="save_money.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="save_money.Article"
android:label="#string/title_activity_article" >
</activity>
<activity
android:name="save_money.HashmalActivity"
android:label="#string/title_activity_hashmal" >
</activity>
<activity
android:name="save_money.ImageAdapter"
android:label="a" >
</activity>
<activity
android:name="save_money.SavedItems"
android:label="פריטים שמורים" >
</activity>
<activity
android:name="save_money.Screen2HashmalActivity"
android:label="עלות צריכה" >
</activity>
<activity
android:name="save_money.SelectArticle"
android:label="בחר מאמר" >
</activity>
</application>
</manifest>
What it means is the package declaration in your manifest must have at least two portions separated by a period (.). Instead of just saying package="save_money", change it to package="com.save_money". That should remove your error. Likewise, everywhere you specify the name of an activity, you also need to update it there. Best of luck!
My guess is you need to have a minimum of 2 segments for your package name.
So instead of package="save_money Try package="me.save_money" or whatever you want.

AndroidManifest.xml The markup in the document following the root element must be well formed

I have got Eclipse to generate a Basic android Hello World app, But it has 2 errors: first, in my AndroidManifest.xml on these two lines:
I get The markup in the document following the root element must be well formed, Also My R.java Will not generate, no matter how many times I clean my project. Any Answers?
the manifest is here: http://jsfiddle.net/NHDU6/
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<!--
Declare the contents of this Android application. The namespace
attribute brings in the Android platform namespace, and the package
supplies a unique name for the application. When writing your
own application, the package name must be changed from "com.example.*"
to come from a domain that you own or have control over.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:icon="#drawable/ic_launcher_home"
android:label="#string/home_title" >
<activity
android:name="Home"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:theme="#style/Theme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Wallpaper"
android:icon="#drawable/bg_android_icon"
android:label="Wallpaper" >
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks, Jonathan
Here is your manifest,
You should not specify more than one Manifest and You should not specify more than one <application> tags.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:icon="#drawable/ic_launcher"
android:label="h" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="Home"
android:launchMode="singleInstance"
android:stateNotNeeded="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Wallpaper"
android:icon="#drawable/ic_launcher"
android:label="Wallpaper" >
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
It may be that you are missing something, but sometimes doing a simple re-format of code: CTRL+SHIFT+F, clears the problem.
I looked at your manifest file. The error is caused because you have 2 declarations of <manifest /> tag.
It begins with:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin"
android:versionCode="1"
android:versionName="1.0" >
Then some comments follow and another declaration starts:
<!--
Declare the contents of this Android application. The namespace
attribute brings in the Android platform namespace, and the package
supplies a unique name for the application. When writing your
own application, the package name must be changed from "com.example.*"
to come from a domain that you own or have control over.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-permission android:name="android.permission.CALL_PHONE" />
Your either forgot to comment one of the manifests tag, confused something, or following a wrong tutorial. The AndroidManifest file should have only one <manifest /> tag
The Auto-generated AndroidManifest.xml file has some problem by itself. There is two manifest tag and two uses-sdk tag inside it. That is the problem. Do as follows:
1- Delete the closing tag of first manifest tag which is:
</manifest>
2- Delete definition tag of the second manifest tag which is:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="net.learn2develop.fragments"
android:versionCode="1"
android:versionName="1.0" >
3- If there is two uses-sdk tag, also delete the second uses-sdk tag.
I added a new activity to my app, and it gave this error after. The manifest disappeared from android-studio completely.
I had to edit the manifest with a text editor. It seems that when I added a new activity, Android Studio created a new tag then added the new activity tag inside in the manifest file, rather than just adding the tag with the new activity in the manifest.
After you update the manifest, the project worked fine.
<?xml version="1.0" encoding="utf-8"?>
< xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.groofy">
<activity
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"/>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar"/>
<activity
android:name=".SignUp"
android:label="#string/title_activity_sign_up"
android:theme="#style/AppTheme.NoActionBar"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
/> should not be at the end of the file I had the same issue the error means the xml file is not correctly formatted you should try removing the / in front of the > or simply reformat

Android manifest.xml problems

Following this: http://developer.android.com/training/basics/firstapp/starting-activity.html I am confused when editing the Android Manifest.xml file. It says that the file should contain this:
<application ... >
<activity android:name="com.example.myapp.DisplayMessageActivity" />
...
</application>
My android manifest.xml looks like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nick.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<application android:label="#string/app_name">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" />
...
</application>
</manifest>
and when I run the app everything goes fine except it says : "No Launcher activity found!
The launch will only sync the application package on the device!" Is this something missing from the android manifest.xml file?
declare Your Activity in AndroidManifest.xml as for Showing In Launcher as:
<application android:label="#string/app_name">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
see for more info how we set an activity which so in Launcher :
http://developer.android.com/reference/android/content/Intent.html
http://developer.android.com/reference/android/app/Activity.html
You need to change you manifest to the following. Doing this will tell Android that you want this Activity to be displayed in the Launcher using your icon.
<application android:label="#string/app_name" android:icon="drawable icon resource here">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" android:label="Your Label">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
In the docs the used ... to show that your normal code goes here. What you're doing is fine for non-launcher Activities.
You are missing the launcher intent and therefore the app finds no activity to launch at the start.
You need to lay out the activity like so:
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

Categories

Resources