1. Download our Official Android App: Forums for Android!

Apps hellow world not working

Discussion in 'Android Development' started by ketanco, Sep 13, 2011.

  1. ketanco

    ketanco Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    25
    Joined:
    Apr 13, 2011

    Apr 13, 2011
    25
    0
    15
    Hi I was trying to write my first android app "hello world"

    and I went to tutorial in developer.android.com

    but

    here is what i got and it didnt work:

    Can you tell me what's wrong?

    The code is as below:

    package com.example.helloandroid;

    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);
    }
    }

    and the messages below were:

    [2011-09-13 22:20:29 - HelloAndroid] ------------------------------
    [2011-09-13 22:20:29 - HelloAndroid] Android Launch!
    [2011-09-13 22:20:29 - HelloAndroid] adb is running normally.
    [2011-09-13 22:20:29 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
    [2011-09-13 22:20:29 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'hello_world_avd'
    [2011-09-13 22:20:29 - HelloAndroid] Launching a new emulator with Virtual Device 'hello_world_avd'
    [2011-09-13 22:20:30 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
    [2011-09-13 22:20:30 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
    [2011-09-13 22:20:30 - Emulator] please use -help for more information
     

    Advertisement

  2. miXer

    miXer Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    313
    Joined:
    Aug 12, 2010

    Aug 12, 2010
    313
    51
    53
    Norway
    Move the android-sdk folder to a path with no spaces in the path like C:\android-sdk
     
  3. ketanco

    ketanco Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    25
    Joined:
    Apr 13, 2011

    Apr 13, 2011
    25
    0
    15
    ok thanks it worked and i got one step further now. but this time, i got new error messages as below:

    [2011-09-14 06:12:40 - HelloAndroid] Android Launch!
    [2011-09-14 06:12:40 - HelloAndroid] adb is running normally.
    [2011-09-14 06:12:40 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
    [2011-09-14 06:12:40 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'hello_world_avd'
    [2011-09-14 06:12:40 - HelloAndroid] Launching a new emulator with Virtual Device 'hello_world_avd'
    [2011-09-14 06:12:43 - Emulator] emulator: warning: opening audio input failed
    [2011-09-14 06:12:43 - Emulator]
    [2011-09-14 06:12:44 - Emulator] emulator: emulator window was out of view and was recentred
    [2011-09-14 06:12:44 - Emulator]
    [2011-09-14 06:12:44 - HelloAndroid] New emulator found: emulator-5554
    [2011-09-14 06:12:44 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
    [2011-09-14 06:16:12 - HelloAndroid] HOME is up on device 'emulator-5554'
    [2011-09-14 06:16:12 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
    [2011-09-14 06:16:12 - HelloAndroid] Installing HelloAndroid.apk...
    [2011-09-14 06:18:29 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
    [2011-09-14 06:18:29 - HelloAndroid] (null)
    [2011-09-14 06:18:29 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554': device not found
    [2011-09-14 06:18:29 - HelloAndroid] com.android.ddmlib.InstallException: device not found
    [2011-09-14 06:18:29 - HelloAndroid] Launch canceled!
     
  4. Sam Voss

    Sam Voss Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    367
    Joined:
    Jun 25, 2010

    Jun 25, 2010
    367
    44
    43
    Programmer, in school
    Wisconsin
    Without knowing more, i would suggest trying to restart the emulator, then make a change in your code (even as simple as deleting a ; and replacing it, then saving) which causes eclipse to regenerate the .apk which also could be a problem
     
  5. jonbonazza

    jonbonazza Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    1,930
    Joined:
    Jul 13, 2010

    Jul 13, 2010
    1,930
    457
    163
    Male
    Also, make sure that you have "Unknown Sources" enabled in your device's settings.
    (Home Screen > Menu Key > Settings > Application)
     
  6. TheCompBoy

    TheCompBoy Android Enthusiast
    Rank:
    None
    Points:
    98
    Posts:
    589
    Joined:
    Oct 18, 2010

    Oct 18, 2010
    589
    53
    98
    Programmer
    Sweden
    Try Sam Voss advice.. I think thats what you're looking for.
     

Share This Page

Loading...