• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Unable to run "hello, android" example

Yngui

Lurker
Dec 11, 2010
3
0
Hi guys. I'm trying to run a "hello android" example as described here: Hello, World | Android Developers
The problem is: the application doesn't launch. When running it, the emulator comes up and loads and loads and finally displays some screen (screenshot: Yfrog Photo : yfrog.com/1gskjermbilde20101211kl19p ) but not the hello world application.

Sourcecode is:

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}

Eclipse version is Helios, ADT is 8.0.1.v201012062107-82219 and the project target was Api 9 Platform 2.3
The eclipse console says:

[2010-12-11 19:16:27 - HelloAndroid] ------------------------------
[2010-12-11 19:16:27 - HelloAndroid] Android Launch!
[2010-12-11 19:16:27 - HelloAndroid] adb is running normally.
[2010-12-11 19:16:27 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-12-11 19:16:27 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'SomeDevice'
[2010-12-11 19:16:27 - HelloAndroid] Launching a new emulator with Virtual Device 'SomeDevice'
[2010-12-11 19:16:30 - Emulator] 2010-12-11 19:16:30.221 emulator[35781:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.

(end of output)

On the first launch the emulator said something about something not responding in time but the error message was gone too soon for me to take a screenshot. I haven't been able to reproduce the error since, even though I created entirely new eclipse projects and new virtual devices.
I've been waiting for more than a quarter now for the emulator to load, so I think I've been patient enough :D

Any ideas? :)
Thank you very much in advance and have a wonderful weekend!
 
Some additional info: according to google, others seem to have solved similar problems by killing the adb process. I remembered to have been wondering why the eclipse "run" button would show a tooltip "already running" when I started the app, so I decided to give it a try and killed that process and restarted eclipse. Now I can't even start the emulator anymore, eclipse says: Problem occured. Launching HelloAndroid HelloAndroid.java has encountered a problem: No python nature for project: HelloAndroid

O.O
This is becoming quite funny.. :)
 
Upvote 0
Seems like I "fixed" it (.. but not really). I tried to run the same app once more and the emulator came up this time, so I started to click on the buttons randomly and then I saw the "hello android" screen after pressing the menu button. It didn't say so in the tutorial, and I expected the app to be displayed automatically. What's even more confusing is that this works only when you press the menu button one time. Second time: app is gone, other menu pops up. Is this intended behaviour? Can anybody tell me if I'm using the emulator correctly? :D

Thanks a lot! :)
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones