I create an Android Application on eclipse , when i want to run it on the Emulator I get The message saying
MyApplicationName.apk installed on device
So normally every thing fine.
But when i want to start my application i did not find it's icon.
And when i go to parametres then manage applications i find it there.
Can anyone tell me why i am not able to find the application's icon on the Emulator ?
here is the manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.enis.testandroid"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
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" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="MainActivity" />
</activity>
</application>
You have missed to add a Launcher in your Manifest file,
<application
android:icon="#drawable/download" <!-- Check this one -->
android:label="#string/app_name" >
<activity
android:name=".abc"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <!-- Check this one -->
</intent-filter>
</activity>
<activity android:name="abc" >
</activity>
<activity android:name="def" >
</activity>
</application>
<application
android:name="com.x.y.z"
android:icon="#drawable/ic_launcher"
android:label="#android:string/abc" >
In manifest, make changes according to your drawable folder icon. Also make sure to use small case for drawable.
Related
I have never fully understood the manifest or how to add items to it. I have the manifest here that is working but I want to change something and I do not know what to change. Here is the manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.magicbuddy.gamble"
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.magicbuddy.gamble.Splash"
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.magicbuddy.gamble.welcomeSplash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.magicbuddy.gamble.Dashboard" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.magicbuddy.gamble.Dashboard"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.magicbuddy.gamble.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.magicbuddy.gamble.Player"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.magicbuddy.gamble.Menu"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.magicbuddy.gamble.Popup"
android:label="#string/title_activity_popup" >
</activity>
</application>
</manifest>
I have 2 new classes I have written. One is called Player.class and the other is called WelcomeSplash.class. Currently, as the manifest shows, that my splash screen loads and works and then the timer on the splash screen auto loads the next screen, the dashboard.class. Instead I want it to load one of my new classes, the WelcomeSplash.class. I do not know how to get my two new classes properly added into the manifest.
startActivity(new Intent(Splash.this, welcomeSplash.class));
I replaced WelcomeSplash with another one of my classes, Dashboard, and it does not force close, it loads and runs just fine.
Just as per your code, i make the changes and post the codehere. check and Use in Manifest..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.magicbuddy.gamble"
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.magicbuddy.gamble.Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity
android:name=".gamble.Dashboard" >
</activity>
<activity
android:name=".MainActivity" >
</activity>
<activity
android:name=".Player" >
</activity>
<activity
android:name=".Menu" >
</activity>
<activity
android:name=".Popup" >
</activity>
<activity android:name=".WelcomeSplash" >
</activity>
</application>
</manifest>
No need to write <intent-filter> again. Thnk you :)
For every new activity you create you need to add the activity block to the manifest in the application section.
To add your new WelcomeSplash class, add the line:
<activity
android:name="com.magicbuddy.gamble.WelcomeSplash"
android:label="#string/app_name" >
between the tags
<application></application>
Once the class is in there your splash class should start the intent with WelcomeSplash.class
As dgg says just add the activities into your Manifest.xml
<application>
...
...
...
<activity
android:name="com.magicbuddy.gamble.Player"
android:label="Player" >
</activity>
<activity
android:name="com.magicbuddy.gamble.welcomeSplash"
android:label="WelcomeSplash" >
</activity>
</application>
if you have the exception "there is no activty to handle intent (com.XXXX.WelcomeSplash) here:
Intent openMainActivity = new Intent("com.magicbuddy.gamble.welcomeSplash");
startActivity(openMainActivity);
you must use:
Intent startMain = new Intent(this, welcomeSplash.class);
startActivity(startMain);
read more about : Android Build an Intent
Here´s a question for you, whats the real name of your class, "WelcomeSplash" or "welcomeSplash", put the correct name on your Manifest.xml and in your Intent! :)
According to Java Standars, Class Names should be in CamelCase, so use "WelcomeSplash".
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
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.
I created an alternate layout in Eclipse
res/layout-land/main.xml
I am using Hello Android 3rd Edition to learn Android.
Am I missing anything?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.oneorangetree.sudoku"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Sodoku"
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=".About"
android:label="#string/about_title"
android:theme="#android:style/Theme.Dialog">
</activity>
</application>
</manifest>
There's a setting "auto-rotate" in setting "display" on the device. Check that it's activated.
You can use Ctrl + F12.
See the possible options here
CLICK HERE
Some people that use my application are complaining that after the update, the launcher icon went missing so they can't start the game. I myself don't have that problem. All ic_launcher.png images are in the drawable maps and I didn't change them.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="wetenschappelijk.project"
android:versionCode="36"
android:versionName="3.0.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:label="#string/app_name"
android:name=".GalgjeActivity"
android:configChanges="orientation|keyboardHidden"
>
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MenuActivity"
/>
<activity
android:name=".GameActivity"
/>
<activity
android:name="wetenschappelijk.project.Settings"
/>
<activity
android:name="wetenschappelijk.project.Multiplayer"
/>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<meta-data android:value="a14ef899d6be24a" android:name="ADMOB_PUBLISHER_ID"/>
</application>
if there is no icon name :ic_launcher..
at that time the there is default icon name :icon.png already there
Edit:
As I showed in your manifest file .
you didn't display API minimum version.
may be that is issue:
<uses-sdk android:minSdkVersion="8" />