Android-Hello World

前端 未结 12 1511
无人共我
无人共我 2021-01-11 09:59

I\'m currently learning how to create android applications so I started with the basic \"Hello World\" tutorial over at the Android Developers home page. The code is quite s

相关标签:
12条回答
  • 2021-01-11 10:11

    go to the run configurations and select target tab. under this tab you can see your targets. then select automatically radio button and select a check box of AVD. then try to run, most probably your issue will be solved.

    0 讨论(0)
  • 2021-01-11 10:18

    I assume you are using the emulator. You have to be patient; it takes a very long time to start up (several minutes.) You can start the emulator manually by going to the Window menu in Eclipse, selecting "the Android SDK and ADB manager," clicking on the emulator you created and then clicking on the Start button. Wait until you see the home screen. If necessary, unlock it by clicking and dragging the mouse down over the screen until it's unlocked.

    If you have access to a physical phone and USB cable, you will have a much better (faster) experience overall.

    Good luck!

    0 讨论(0)
  • 2021-01-11 10:18

    I had the same problem and this is how I resolved.

    if you run

    adb devices

    I had nothing on the list. So did.

    adb kill-server

    and

    adb start-server

    Now if you run the emulator again, the Activity oncreate event will hook properly. Not sure if this is intended but on the first run on the emulator does not work. And someone confirm on this? Thanks.

    0 讨论(0)
  • 2021-01-11 10:18

    I restarted my virtual device with the option Wipe User Data checked and then reran my app. That finally worked for me.

    Note that in response to the other comments, I also tried the following:

    • Simply restarting the device
    • Restarting the device after changing the VM heap size
    • Restarting my computer
    0 讨论(0)
  • 2021-01-11 10:21

    I had the same problem I was running Android 3.1 Java 1.6 on Eclipse. Just rerun the build process and it kicks in the second time.

    0 讨论(0)
  • 2021-01-11 10:23

    I also encountered error when followed instructions, so i ran "adb logcat" which showed that it is not able to find the class.

    In the instructions(tutorial) - : It has been said that (during create new project or class)application name set to Hello World and activity name became HelloWorldActivity.

    So if you maintain both CreateActivity name and application name both same, then it might work.

    I have increased the AVD RAM size to 1024 and VM application to 36 0r 48 or 24.

    0 讨论(0)
提交回复
热议问题