Unable to run application after installing on phone - android

When I clicked run, the apk used to auto start up on my phone before, but now it just remains unchanged on the developer option,
once i click run on eclipse, it shows the following on the console:
[2014-03-11 16:26:36 - MyFirstApp] ------------------------------
[2014-03-11 16:26:36 - MyFirstApp] Android Launch!
[2014-03-11 16:26:36 - MyFirstApp] adb is running normally.
[2014-03-11 16:26:36 - MyFirstApp] No Launcher activity found!
[2014-03-11 16:26:36 - MyFirstApp] The launch will only sync the application package on
[2014-03-11 16:26:36 - MyFirstApp] Performing sync
[2014-03-11 16:26:36 - MyFirstApp] Automatic Target Mode: Unable to detect device
[2014-03-11 16:26:38 - MyFirstApp] Uploading MyFirstApp.apk onto device 'EP73226B61'
[2014-03-11 16:26:38 - MyFirstApp] Installing MyFirstApp.apk...
[2014-03-11 16:26:41 - MyFirstApp] Success!
[2014-03-11 16:26:41 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-03-11 16:26:41 - MyFirstApp] Done!
But as i said nothing come up on my phone,
then I try other method like putting the apk into my download file and installed it , it says, Do you want to install an update to this existing application? Your existing data will not be lost. it does not require any special access. once i click on install, it shows application installed and leaving my two button, Done and Open. But the "open" button is non-clickable
Is wired, I can't find it neither in internal storage and SD card, not even in my install app list.
My setting
USB debugging is clicked
stay awaked is clicked
This is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:name="com.example.myfirstapp.MainActivity"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity
android:name="com.example.myfirstapp.Display1MessageActivity"
android:label="#string/title_activity_display1_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" />
</activity>
</application>
</manifest>
my android version is 4.3 is sony ZR

Check your AndroidManifest.xml file. It should contain something like this:
<application details omitted>
<activity details omitted>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
If you don't have an intent filter like the one shown above, Android does not know which activity to start to launch your application.

Related

Android app not showing on my device. No Launcher Activity Found

I am simply following the Android Developer training guide, and I am already running into troubles on the second step.
I followed the guide (I don't even have to do anything..) and clicked on Run, selected my Galaxy S4 from the screen, and clicked okay. I get the following error
[2014-07-06 19:56:27 - MyFirstApp] Android Launch!
[2014-07-06 19:56:27 - MyFirstApp] adb is running normally.
[2014-07-06 19:56:27 - MyFirstApp] No Launcher activity found!
[2014-07-06 19:56:27 - MyFirstApp] The launch will only sync the application package on the device!
[2014-07-06 19:56:27 - MyFirstApp] Performing sync
[2014-07-06 19:56:27 - MyFirstApp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-07-06 19:56:31 - MyFirstApp] Application already deployed. No need to reinstall.
[2014-07-06 19:56:31 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-07-06 19:56:31 - MyFirstApp] Done!
I honestly have no idea what I am doing wrong, as I have absolutely no experiences with android.
The only thing that is different is in the tutorial their targetSdkVersion is 19, but I am using 21
The following is my AndroidManefiest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
</manifest>
You forgot to declare your activity to your Manifest.xml.
Everytime you create an activity (blablabla class extends Activity) you have to declare it to your Android Manifest.xml, in order to de device be able to track your App's life cicle.
What we call Activity is a class that provide information to host a window, the class should extends Activity, all of this classes must be declared on the Manifest.xml file as below:
<application>
...
<activity
android:name="com.yourpackage.ClassName">
</activity>
</application>
Probably your activity class is called MainActivity, you just have to add this to your code, between <application> </application> tag:
<activity
android:name="com.example.myfirstapp.MainActivity"
android:label="#string/app_name"> <!-- This is the text that will appear on your action bar -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The <intent-filter> tells to android that this class is the "main entrance", the first activity that need to be loaded to your app be launched, only the first activity need the <intent-filter> tag, the others just need the fist example I gave.
If you are starting with Android development, I recommend you to read about ActionBar and What to do when the device is rotated
This and this may help you in the future.
Good coding :)
Put the following intent-filter for your activity to be launched.
<activity class=".YourActivity" android:label="your activity label">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
{ action=android.app.action.MAIN } matches all of the activities that
can be used as top-level entry points into an application.
{ action=android.app.action.MAIN,
category=android.app.category.LAUNCHER } is the actual intent used by
the Launcher to populate its top-level list.
Also, please refer to Intent

Where can I find the apk file on my Android phone?

I am trying to develop android applications with eclipse (following this tutorial ). Clicking the 'Run' button inside eclipse (running on Linux) and choosing an android device, eclipse tells me that the application is successfully installed on the device.
[2014-07-02 19:26:55 - MyFirstApp] Installing MyFirstApp.apk...
[2014-07-02 19:27:01 - MyFirstApp] Success!
[2014-07-02 19:27:02 - MyFirstApp] /MyFirstApp/bin/MyFirstApp.apk installed on device
[2014-07-02 19:27:02 - MyFirstApp] Done!
However, I cannot find this application in the list of installed applications on the phone. It only shows up in Settings -> Applications where I am only able to remove it, but not to start it. Maybe I need to do something special in order to let the app show up normally and useable?
As a next step, I installed an 'AppInstaller' to install the apk file. But I do now know which folder on the android phone the apk has been copied to. Where did eclipse put the apk in?
This is in the manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
</manifest>
The most likely cause is that you didn't specify a launcher activity in the Manifest.
<activity android:name="... >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
From the documentation:
The ACTION_MAIN action indicates this is the main entry point and does not expect any intent data.
The CATEGORY_LAUNCHER category indicates that this activity's icon should be placed in the system's app launcher. If the
element does not specify an icon with icon, then the system uses the
icon from the element.

My app not appear on AVD

When I try to create a new Android project and run it it did not appear on the emulator.
This is the console message :
[2014-04-12 00:30:57 - Fir] Android Launch!
[2014-04-12 00:30:57 - Fir] adb is running normally.
[2014-04-12 00:30:57 - Fir] Performing com.example.fir.MainActivity activity launch
[2014-04-12 00:31:05 - Fir] Uploading Fir.apk onto device 'emulator-5554'
[2014-04-12 00:31:06 - Fir] Installing Fir.apk...
[2014-04-12 00:31:22 - Fir] Success!
[2014-04-12 00:31:22 - Fir] Starting activity com.example.fir.MainActivity on device emulator-5554
I wait more than one hour and its not appear? And I try to kill-server adb and start it again, but still the same problem.
Please help...
Try the genymotion Emulator. It is faster than the normal android Emulator.
Can you post your manifest.xml?
This is my manifest.xml ,And i will try the genymotion Emulator
` <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fir"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.fir.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>
</application>
</manifest>`

Using Hardware Device but cannot find installed app

I followed the procedure on Using Hardware Device from google android's page, after having problems with emulator. After having followed everything provided on google's hardware page, i created a new project and ran it, it gave me the following,
[2014-03-17 18:35:18 - FirstAppProject] ------------------------------
[2014-03-17 18:35:18 - FirstAppProject] Android Launch!
[2014-03-17 18:35:18 - FirstAppProject] adb is running normally.
[2014-03-17 18:35:18 - FirstAppProject] No Launcher activity found!
[2014-03-17 18:35:18 - FirstAppProject] The launch will only sync the application package on the device!
[2014-03-17 18:35:18 - FirstAppProject] Performing sync
[2014-03-17 18:35:18 - FirstAppProject] Automatic Target Mode: using device '0123456789ABCDEF'
[2014-03-17 18:35:18 - FirstAppProject] Uploading FirstAppProject.apk onto device '0123456789ABCDEF'
[2014-03-17 18:35:19 - FirstAppProject] Installing FirstAppProject.apk...
[2014-03-17 18:35:25 - FirstAppProject] Success!
[2014-03-17 18:35:25 - FirstAppProject] \FirstAppProject\bin\FirstAppProject.apk installed on device
[2014-03-17 18:35:25 - FirstAppProject] Done!
Which seem to me that the app is installed on my device, but i cant seem to find the app on my device so that i can test it.
What to do ?
If that is your manifest:
<manifest xmlns:android="schemas.android.com/apk/res/android";
package="com.faizanchaki.firstappproject" 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" >
<!-- no activities declared here -->
</application>
</manifest>
Then you are missing the declaration of a main activity like:
<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>
you should declare the main activity in your Manifest so that your app icon will appear in the android launcher and you will be able to actually start your app. Just put your Activity name and add it to the main manifest where I put the comment.

Android App Runs in Emulator, But Not Listed In Launcher

I am learning Android and can not get my program to show up in the program listings drawer of my Nexus S emulated device. When I load up the emulator, it does load my program successfully, after hitting "run new configuration". I know there are a ton of threads on this...but from what I can tell I have everything right in my manifest with:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Also, to be clear the run configuration in Eclipse does run my program successfully. It's just not in the apps menu/drawer of the emulated device to click and run:
[2013-03-07 20:14:04 - TodDoList] New emulator found: emulator-5554
[2013-03-07 20:14:04 - TodDoList] Waiting for HOME ('android.process.acore') to be launched...
[2013-03-07 20:14:46 - TodDoList] HOME is up on device 'emulator-5554'
[2013-03-07 20:14:46 - TodDoList] Uploading TodDoList.apk onto device 'emulator-5554'
[2013-03-07 20:14:47 - TodDoList] Installing TodDoList.apk...
[2013-03-07 20:15:23 - TodDoList] Success!
[2013-03-07 20:15:23 - TodDoList] Starting activity com.paad.toddolist.ToDoListActivity on device emulator-5554
[2013-03-07 20:15:24 - TodDoList] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.paad.toddolist/.ToDoListActivity }
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paad.toddolist"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.paad.toddolist.ToDoListActivity"
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>
</manifest>
Here is my strings.xml file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">TodDoList</string>
<string name="addItemHint">New To Do List</string>
<string name="addItemContentDescription">New To Do Item</string>
</resources>
Try replacing
android:name="com.paad.toddolist.ToDoListActivity"
with
android:name=".ToDoListActivity"

Categories

Resources