views:

42

answers:

3

Hi,

as a newbie, I tried out the HelloAndroid example at developer.android.com. After apgrading the UI to XNL layout as described, I get these error messages in the console log:

[2010-08-26 11:44:49 - HelloAndroid] WARNING: Application does not specify an API level requirement! [2010-08-26 11:44:49 - HelloAndroid] Device API version is 8 (Android 2.2)

The programmatic UI layout worked fine before. Where die I make a mistake?

A: 

Open your AndroidManifest.xml file and add this tag below your </application> tag

<uses-sdk android:minSdkVersion="8" />

Edit

This is just a warning and all it means is you need to put the Minimum SDK number in your AndroidManifest.xml.Check whether you have added a TextView to your layout and add a text to it?. Also see to it that it is visible on the layout(set a proper height and width)

Rahul
That didn't work out right - maybe because I am not sure where to place the tag. I tried different locations - always the same error message. What exactly do you mean by "below your tag"?
Nexo
i typed </application> there unfortunately it did not get displayed . In short it should be outside of <application> but inside <manifest>
Rahul
A: 

Ok, the error messages do not appear any more, but the app does not start anyway. This is the complete AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.helloandroid"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".HelloAndroid"
                  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>
    <uses-sdk android:minSdkVersion="8" />
</manifest> 

This is main.xml:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/textview"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"  
  android:text="@string/hello"/>

This is strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World, HelloAndroid!</string>
    <string name="app_name">Hello, Android String</string>
</resources>

This is the Eclipse log:

[2010-08-26 16:05:41 - HelloAndroid] ------------------------------

[2010-08-26 16:05:41 - HelloAndroid] Android Launch!

[2010-08-26 16:05:41 - HelloAndroid] adb is running normally.

[2010-08-26 16:05:41 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch

[2010-08-26 16:05:41 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'Testprogramm'

[2010-08-26 16:05:41 - HelloAndroid] Launching a new emulator with Virtual Device 'Testprogramm'

[2010-08-26 16:05:42 - HelloAndroid] New emulator found: emulator-5554

[2010-08-26 16:05:42 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...

[2010-08-26 16:06:17 - HelloAndroid] HOME is up on device 'emulator-5554'

[2010-08-26 16:06:17 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'

[2010-08-26 16:06:19 - HelloAndroid] Installing HelloAndroid.apk...

[2010-08-26 16:07:02 - HelloAndroid] Success!

[2010-08-26 16:07:02 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device

[2010-08-26 16:07:05 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.helloandroid/.HelloAndroid }

After more than two minutes without activity I started the app again:

[2010-08-26 16:09:16 - HelloAndroid] ------------------------------

[2010-08-26 16:09:16 - HelloAndroid] Android Launch!

[2010-08-26 16:09:16 - HelloAndroid] adb is running normally.

[2010-08-26 16:09:16 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch

[2010-08-26 16:09:16 - HelloAndroid] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Testprogramm'

[2010-08-26 16:09:19 - HelloAndroid] Application already deployed. No need to reinstall.

[2010-08-26 16:09:19 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device

[2010-08-26 16:09:21 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.helloandroid/.HelloAndroid }

[2010-08-26 16:09:21 - HelloAndroid] ActivityManager: Warning: Activity not started, its current task has been brought to the front

Any ideas?

Nexo
You shouldn't use stackoverflow like a normal forum, because it is not guaranteed that answers always stay in the same chronological order. To inform other users about some new facts or new informations regarding your problem just edit your original questions.
Flo
A: 

I have gotten this error before. What I did was make sure that nothing else is running in the emulator. If the emulator has another program running it can sometimes prohibit the new task from starting. I don't know why.

CornCat
I have only the HelloAndroid app running in the emulator. There must be something else ...
Nexo