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.
Related
I am trying to run a demo project to implement widgets, it compiles successfully but did not launch, also I did not find it installed in my phone.
I am following this tutorial http://www.tutorialspoint.com/android/android_widgets.htm
A also this tutorial https://github.com/TechIsFun/android-widget-example but getting the same problem.
My console shows
[2014-11-23 11:01:30 - WidgetExample] Performing sync
[2014-11-23 11:01:30 - WidgetExample] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-11-23 11:01:34 - WidgetExample] Uploading WidgetExample.apk onto device '1C9E_9E18_MicromaxA111'
[2014-11-23 11:01:34 - WidgetExample] Installing WidgetExample.apk...
[2014-11-23 11:01:37 - WidgetExample] Success!
[2014-11-23 11:01:37 - WidgetExample] \WidgetExample\bin\WidgetExample.apk installed on device
[2014-11-23 11:01:37 - WidgetExample] Done!
I think there is some problem with the manifest file ?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.widgetexample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<receiver
android:name="MyWidgetProvider"
android:icon="#drawable/ic_launcher"
android:label="Example Widget" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_info" />
</receiver>
</application>
</manifest>
Your console message shows that your apk is isntalled sccuessfully on the device. Now the question is why it is not getting launched?
To launch any application, it should have at least one activity with action as main and category as launcher.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
In your case, your application don't have any activity assoicated with it.
I think this is the casue why its not getting launched afer sccuessful installation. also thats why its not showing your application on application list.
As your application have only one widget hence it will show it under widgets list. Please check.
Hope it helps you.
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
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.
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.
I changed some code on an android application that was working perfectly fine at least 3 days ago (note, this was not three days of coding, I have not done THAT many changes). Now, instead of running along on its merry way, it is ambushed and killed as soon as it gets out of the door. At least, I think that I am interpreting the output correctly:
[2010-08-06 14:07:04 - chart] Android Launch!
[2010-08-06 14:07:04 - chart] adb is running normally.
[2010-08-06 14:07:04 - chart] Performing org.achartengine.chartdemo.demo.ChartDemo activity launch
[2010-08-06 14:07:04 - chart] Automatic Target Mode: using device 'HT03LHF01264'
[2010-08-06 14:07:04 - chart] WARNING: Application does not specify an API level requirement!
[2010-08-06 14:07:04 - chart] Device API version is 3 (Android 1.5)
[2010-08-06 14:07:04 - chart] Uploading chart.apk onto device 'HT03LHF01264'
[2010-08-06 14:07:04 - chart] Installing chart.apk...
[2010-08-06 14:07:08 - chart] Success!
[2010-08-06 14:07:08 - chart] Starting activity org.achartengine.chartdemo.demo.ChartDemo on device
[2010-08-06 14:07:11 - chart] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined
[2010-08-06 14:07:11 - chart] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined
[2010-08-06 14:07:12 - chart] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={org.achartengine.chartdemo.demo/org.achartengine.chartdemo.demo.ChartDemo} }
[2010-08-06 14:07:12 - chart] ActivityManager: [1] Killed am start -n org....
Anyway, does anybody have ideas as to what might be causing the immediate killing of a program?
Problem identified by Aidanc. The manifest file that was giving me trouble was
<?xml version="1.0" encoding="utf-8" ?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.achartengine.chartdemo.demo" android:versionCode="1" android:versionName="1.0.0">
- <application android:icon="#drawable/icon" android:label="#string/app_name" android:permission="android.permission.CAMERA">
- <activity android:name=".ChartDemo" android:label="AChartEngine demo">
- <intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.achartengine.chartdemo.demo.chart.XYChartBuilder" />
<activity android:name="org.achartengine.GraphicalActivity" />
<activity android:name=".GeneratedChartDemo" />
<activity android:name="DisplayImage" />
</application>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-sdk android:minSdkVersion="3" />
</manifest>
perhaps a permissions problem? Have you set permissions correctly for the code you added in the Manifest file? its hard to tell without seeing some code. We need to know what exactly your program does at launch?
Also, whats the Log cat output? does anything run? what's it showing there? does an error show? if it does could you edit your question and put it there?
//edit
<application android:icon="#drawable/icon" android:label="#string/app_name" android:permission="android.permission.CAMERA">
Trying removing android:permission="android.permission.CAMERA" from this
As oliver said, that is a serious problem.
Also I highly highly recommend the use of a version control system to track any and all changes made to your code base. For example GIT or SVN. I think SVN integrates into Eclipse better. That way you could just diff between two versions and know immediately what changed.
Your log says:
WARNING: Application does not specify an API level requirement!
That's quite a problem. There may be something wrong in your manifest around <uses-sdk />
If not, then you could also try Project/Clean in Eclipse to rebuild everything.