0

I'm going through the Android 'Building Your First App' tutorial and have gotten stuck trying to run the app. I created the app and emulator with Eclipse (Juno Build id: 20120920-0800 on OS X, default installation. The Android SDK, etc. was updated today).

The app appears to be installed on the emulator. I.e. 'Home -> Menu -> Manage Apps' lists it and it's App info looks ok. (Total=24.00KB, App=24.00KB, USN storage app=0.00B, ...).

However, it does not appear in the apps launch list (i.e. the screen with 'API Demos', 'Browser', etc.

Is there some other way to launch it? Is there something I have to do to get it into the app list? Any help would be appreciated - this is driving me crazy.

thanks

user1813790
  • 81
  • 1
  • 6

1 Answers1

0

In your manifest xml file you need to make sure that you have

        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" /> 
        </intent-filter>

in your activity definition. If you don't see your application in the launcher then it suggests you don't have "android.intent.category.LAUNCHER" set.

Your manifest file should have something like (this isn't a complete manifest)

        <application android:icon="@drawable/icon" android:label="@string/app_name">
         <activity android:name=".MyActivity"
                    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>

You can't just put the intent-filter lines in your manifest. If you double click the manifest it will open up. You get 2 methods to edit it, raw XML or using a basic interface. Personally I think you're better off with the raw interface. Look below the window that opens when you double click the manifest, you'll see some tabs like Manifest, Application... the last on is AndroidManifest.xml - this is the raw xml. The first one is basic setup.

Don't forget to save your manifest file and do a clean and build then run it.

Fuzzy
  • 847
  • 9
  • 23
  • ^ Thanks. This was not in the manifest file that the plugin created, but adding it did not to help. I'm wondering if the plugin is worth bothering with. Is there any decent documentation on creating apps other than google's tutorial? – user1813790 Nov 11 '12 at 01:23
  • Just clarifying where the intent filter lines should go. Which tutorial are you following? – Fuzzy Nov 11 '12 at 01:44
  • I deleted and recreated the app using the command line tools (rather than eclipse). The manifest file created by 'android create project ...' matches the example above. But when the app is installed on a device (using adb), it does not appear in the apps list or in the launcher. – user1813790 Nov 11 '12 at 15:01