My application installs, atleast according to Eclipse, as it should. Then it stops with the following in the console:
[2011-10-17 14:10:58 - AppName] Uploading AppName.apk onto device 'emulator-5554'
[2011-10-17 14:11:07 - AppName] Installing AppName.apk...
[2011-10-17 14:11:23 - AppName] Success!
[2011-10-17 14:11:24 - AppName] \AppName\bin\AppName.apk installed on device
[2011-10-17 14:11:24 - AppName] Done!
When i click the launcher icon i get a toast saying:
"Application is not installed on your phone"
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.qualifiedpath.appname"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity
android:name="com.qualifiedpath.appname.AppTitleScreenActivity"
android:label="label"
android:screenOrientation="portrait"
android:noHistory="false"
android:launchMode="standard">
</activity>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity
android:name=".GameScreenActivity"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".KeypadActivity"
android:screenOrientation="portrait"
android:excludeFromRecents="true">
</activity>
</application>
</manifest>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
you have put the above code out of activity tag.Put it inside activity tag.
change this
<activity android:name="com.qualifiedpath.appname.AppTitleScreenActivity"
android:label="label"
android:screenOrientation="portrait"
android:noHistory="false"
android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
you need to place intent filter inside the activity tag
use this code
<activity
android:name="com.qualifiedpath.appname.AppTitleScreenActivity"
android:label="label"
android:screenOrientation="portrait"
android:noHistory="false"
android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Related
I made the second page a menu. I want the second page to open when the apk opens. How can I do this with code? I only need a code
Inside your AndroidManifest.xml file you will have something like this:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
And you something like this for other acitivities:
<activity
android:name=".SecondActivity" />
What you need to do is just copy/paste that <intent-filter></intent-filter> tags to the SecondActivity, and you get this:
<activity android:name=".SecondActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and
<activity
android:name=".MainActivity" />
Your code in AndroidManifest.xml file is like following:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SecondActivity"/>
You just have to set the second activity as the launcher of the app, i.e copy/paste <intent-filter> from .MainActivity to .SecondActivity. Like this:
<activity android:name=".MainActivity"/>
<activity android:name=".SecondActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
And that's it! Now the second page opens the app.
So I have very weird problem with android app that I developed that I really do not understand how to address.
Description of the problem: When I run the app in my emulator(and many other emulators) the app works perfectly, but when I list it on Google Play and some user download the app, it automatically crashes. so I just wonder if my androidmainfest is properly written.
*the program written in esclipse, java, android.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app"
android:versionCode="6"
android:versionName="1.5" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.example.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.SurfaceExampleView"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.example.start" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.RulesGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.rules" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.PolicyGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.policy" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.RevenueGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.revenue" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.ShopGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.shop" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
You have posted only your manifest and not the logs. My guesses based on that is the problem may be within your package declaration, rest everything seems fine.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app".....
The package should be unique and its like what we call package in java world. You have declared it as com.app whereas your app is using com.example.... package. Also com.app maybe used by other app.The package name defines your application's identity.
Once you publish your application, you cannot change the package name. As the package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version. So you may have to upload another app with different package name.
Try getting logs(use crashlytics) for your crash and we can look into it for the root cause.
I am just learning how to program apps for android, so please bear with me. My original starting activity was called Menu.Java. When I tested the app on my phone, a launcher icon would show up and I could launch the app from it. I decided to add a different Activity for my start up, which is called Login.java. I changed the intents to .MAIN and .LAUNCHER and now my icon won't show up at all. I tried switching it back to the Menu.Java and that worked for a bit (but clicking the icon would load the Menu Activity, and I was wanting the Login Activity loaded), but now that doesn't even work.
EDIT: I have also removed all of the activities from the manifest except the .Login Activity. Did not work.
Here is my Manifest:
`
<application
android:icon="#+drawable/ic_squirrel"
android:label="#string/app_name" >
<activity android:name="com.example.advanced.Login" >
<intent-filter>
<action android:name="com.example.advanced.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Settings"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.InternalStore"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.INTERNALSTORE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Reading"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.READING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Passing"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.PASSING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Numbers"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.NUMBERS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
`
<activity android:name="com.example.advanced.Login" >
<intent-filter>
<action android:name="com.example.advanced.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Here change the <intent-filter> to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
When I specify the .main class as the launcher, it crashes on launch. So I made a new activity called launch that will be used to open the .main class. When I specify .launch as the LAUNCHER, the console tells me that no launcher activity was found.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.homework"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
<application android:label="#string/app_name"
android:theme="#style/AppTheme"
android:allowBackup="true">
<activity android:name=".launch"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.LAUNCH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".menu"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".list"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.LIST" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Change
<intent-filter>
<action android:name="android.intent.action.LAUNCH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Well, does the com.my.homework.launch class exist? Does it subclass Activity? Also, the action should still be <action android:name="android.intent.action.MAIN" />.
Android-Installing to device using eclipse install two instance of same app at once-error
and it runs when just after installed using the eclipse but when I touch the once of the icon its not starting it shows me the android common error syaing unexpectedly stopped!! please help me??
This is the manifest I'm using(activities)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hunter99x"
android:icon="#drawable/icon"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".main" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".origine" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.origine" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity `enter code here`android:name=".Gameover" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LandingScreen" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
I think the issue is because you have repeated
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
this for 2 activities. Try removing this and declare just 1 acivity as your main. Tjis may solve your issue.
Try this code inside the activities and check if it works:
#Override
public void onBackPressed() {
finish();
System.exit(0);
}