Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning Android Application Development
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Android Application Development
This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android Application Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 18th, 2011, 07:23 AM
Registered User
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 1 - HelloWorld Problem

Hi -

I am running Windows XP instead of Win 7. I am a total noob when it comes to Android development on Eclipse so when I hit the slightest bump in the road I am clueless as to what to try next. Here's what I get when I try to start the project with F11 as per step 9, page 18:



[2011-05-18 12:12:09 - HelloWorld] Android Launch!
[2011-05-18 12:12:09 - HelloWorld] adb is running normally.
[2011-05-18 12:12:09 - HelloWorld] Performing net.learn2develop.HelloWorld.MainActivity activity launch
[2011-05-18 12:12:09 - HelloWorld] Automatic Target Mode: launching new emulator with compatible AVD 'Android_2.3_Emulator'
[2011-05-18 12:12:09 - HelloWorld] Launching a new emulator with Virtual Device 'Android_2.3_Emulator'
[2011-05-18 12:12:11 - HelloWorld] New emulator found: emulator-5554
[2011-05-18 12:12:11 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched...
[2011-05-18 12:12:35 - HelloWorld] emulator-5554 disconnected! Cancelling 'net.learn2develop.HelloWorld.MainActivity activity launch'!

Now what?

NOTE ADDED DURING EDITING:

Well, I seem to have solved my own problem by the oldest trick in the book, "turning it off / turning it back on". I exited Eclipse and restarted it, reloaded the HelloWorld project and tried again. This gives me:

[2011-05-18 12:33:58 - HelloWorld] Android Launch!
[2011-05-18 12:33:58 - HelloWorld] adb is running normally.
[2011-05-18 12:33:58 - HelloWorld] Performing net.learn2develop.HelloWorld.MainActivity activity launch
[2011-05-18 12:33:58 - HelloWorld] Automatic Target Mode: launching new emulator with compatible AVD 'Android_2.3_Emulator'
[2011-05-18 12:33:58 - HelloWorld] Launching a new emulator with Virtual Device 'Android_2.3_Emulator'
[2011-05-18 12:34:00 - HelloWorld] New emulator found: emulator-5554
[2011-05-18 12:34:00 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched...
[2011-05-18 12:36:00 - HelloWorld] HOME is up on device 'emulator-5554'
[2011-05-18 12:36:00 - HelloWorld] Uploading HelloWorld.apk onto device 'emulator-5554'
[2011-05-18 12:36:00 - HelloWorld] Installing HelloWorld.apk...
[2011-05-18 12:38:09 - HelloWorld] Success!
[2011-05-18 12:38:09 - HelloWorld] Starting activity net.learn2develop.HelloWorld.MainActivity on device emulator-5554
[2011-05-18 12:38:12 - HelloWorld] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=net.learn2develop.HelloWorld/.MainActivity }
[2011-05-18 12:38:16 - HelloWorld] Attempting to connect debugger to 'net.learn2develop.HelloWorld' on port 8678

and there is Hello World on the emulator. If the longest journey starts with a single step, I just took mine. Thanks, weimenglee.

Last edited by rickyjames; May 18th, 2011 at 07:41 AM..
Reply With Quote
  #2 (permalink)  
Old May 18th, 2011, 08:36 AM
Registered User
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sigh

Well, I would call the operation of the Android emulator as highly buggy on my system.

The first time I tried it I got the results described above.

The second time it displayed the hello world text and button, but then I got a Microsoft error that windows must close emulator.exe dur to an unknown error when I clicked on the "home" button per Step 11.

The third time I tried it the background (sunrise over water) screen for the emulator came up but froze for a half hour without showing the hello world text and button. Eventually (upon moving the mouse after leaving it alone for so long?) the Microsoft "emulator.exe has encountered a problem" window came up following console commentary:

[2011-05-18 12:46:17 - HelloWorld] Android Launch!
[2011-05-18 12:46:17 - HelloWorld] adb is running normally.
[2011-05-18 12:46:17 - HelloWorld] Performing net.learn2develop.HelloWorld.MainActivity activity launch
[2011-05-18 12:46:17 - HelloWorld] Automatic Target Mode: launching new emulator with compatible AVD 'Android_2.3_Emulator'
[2011-05-18 12:46:17 - HelloWorld] Launching a new emulator with Virtual Device 'Android_2.3_Emulator'
[2011-05-18 12:46:19 - HelloWorld] New emulator found: emulator-5554
[2011-05-18 12:46:19 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched...
[2011-05-18 12:47:24 - HelloWorld] HOME is up on device 'emulator-5554'
[2011-05-18 12:47:24 - HelloWorld] Uploading HelloWorld.apk onto device 'emulator-5554'
[2011-05-18 12:47:24 - HelloWorld] Installing HelloWorld.apk...
[2011-05-18 12:48:09 - HelloWorld] Success!
[2011-05-18 12:48:09 - HelloWorld] Starting activity net.learn2develop.HelloWorld.MainActivity on device emulator-5554
[2011-05-18 12:48:12 - HelloWorld] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=net.learn2develop.HelloWorld/.MainActivity }
[2011-05-18 12:48:15 - HelloWorld] Attempting to connect debugger to 'net.learn2develop.HelloWorld' on port 8716

Sigh. Failure on 3 for 3. I'll try this all again on my work computer next.
Reply With Quote
  #3 (permalink)  
Old May 19th, 2011, 02:00 PM
Registered User
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Success At Work

Huh. Can't seem to get a stable Android emulator up on my Dell Dimension C521 desktop at home but things seem to operate fine on my docked Dell E6400 laptop at work - both running XP. Onward...

Last edited by rickyjames; May 19th, 2011 at 02:06 PM..
Reply With Quote
  #4 (permalink)  
Old May 19th, 2011, 09:58 PM
Registered User
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For the first problem: Eclipse can be a bit weird sometimes. Usually in Eclipse when you know something should work, but it isn't, you should save all your open files, close them from the viewer, then go up to the top bar and select "Project" then "Clean..." and then try again. Since it cleans when it opens the project, that's probably why closing it and opening it worked. Still, the easier way is to just use "Clean..."

For the second problem, after checking about a bit: Which service pack do you have for XP? A few other people have had problems with the emulator, and going from service pack 2 to service pack 3 fixed it for them.

Only other suggestion I would have is launch the emulator well before you try to launch your program. Most of the time, when I run the program I'm testing at the same time I launch the emulator, it hangs for a couple minutes.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2, Understanding HelloWorld is insufficient. AndrewDover BOOK: Professional Android 2 Application Development 3 July 14th, 2011 01:48 PM
Chapter 10 HelloWorld function ChuckASP BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 April 2nd, 2010 03:39 PM
Chap 9 HelloWorld Plug problems. chucknb28409 BOOK: Professional Joomla! ISBN: 978-0-470-13394-1 2 June 26th, 2009 07:33 PM
problem in helloworld progarmme in chapt 18 clnbabu BOOK Beginning Linux Programming, 3rd Edition 0 August 25th, 2007 03:54 AM



All times are GMT -4. The time now is 04:04 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.