Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
This is the forum to discuss the Wrox book Professional Android Application Development by Reto Meier; ISBN: 9780470344712
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 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 June 18th, 2009, 01:15 AM
Registered User
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not able to run Chapter7_Sample_WhereAmI

Hi,

When i try to run this example, i am getting below error as alert, could anyone please help me.

[IMG]file:///C:/DOCUME%7E1/nvejja/LOCALS%7E1/Temp/moz-screenshot-3.jpg[/IMG]Sorry! The Application has stopped unexpectedly. Please try again.


Thanks,
Nagesh
Reply With Quote
  #2 (permalink)  
Old October 5th, 2009, 05:29 PM
Registered User
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm getting this same error: The application... has stopped unexpectedly, please try again." I do have a valid maps key; logcat displays the following:

Code:
E/AndroidRuntime(  786): java.lang.NullPointerException
E/AndroidRuntime(  786):        at com.example.movingdroid.MyPositionOverlay.draw(MyPositionOverlay.java:33)
E/AndroidRuntime(  786):        at com.google.android.maps.Overlay.draw(Overlay.java:179)
E/AndroidRuntime(  786):        at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:45)
E/AndroidRuntime(  786):        at com.google.android.maps.MapView.onDraw(MapView.java:476)
E/AndroidRuntime(  786):        at android.view.View.draw(View.java:6274)
E/AndroidRuntime(  786):        at android.view.ViewGroup.drawChild(ViewGroup.java:1526)
E/AndroidRuntime(  786):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
E/AndroidRuntime(  786):        at android.view.ViewGroup.drawChild(ViewGroup.java:1524)
E/AndroidRuntime(  786):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
E/AndroidRuntime(  786):        at android.view.View.draw(View.java:6277)
E/AndroidRuntime(  786):        at android.widget.FrameLayout.draw(FrameLayout.java:352)
E/AndroidRuntime(  786):        at android.view.ViewGroup.drawChild(ViewGroup.java:1526)
E/AndroidRuntime(  786):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
E/AndroidRuntime(  786):        at android.view.ViewGroup.drawChild(ViewGroup.java:1524)
E/AndroidRuntime(  786):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
E/AndroidRuntime(  786):        at android.view.View.draw(View.java:6277)
E/AndroidRuntime(  786):        at android.widget.FrameLayout.draw(FrameLayout.java:352)
E/AndroidRuntime(  786):        at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883)
E/AndroidRuntime(  786):        at android.view.ViewRoot.draw(ViewRoot.java:1332)
E/AndroidRuntime(  786):        at android.view.ViewRoot.performTraversals(ViewRoot.java:1097)
E/AndroidRuntime(  786):        at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
E/AndroidRuntime(  786):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  786):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  786):        at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime(  786):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  786):        at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  786):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(  786):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime(  786):        at dalvik.system.NativeStart.main(Native Method)
A note about my environment: I use the command line (not Eclipse). I build using 'ant debug' - should I be using release? I'm using the "normal" apk - should I be using the -unaligned one?

Any advice would be appreciated, as this example is a large reason why I bought the book! Thanks in advance
Reply With Quote
  #3 (permalink)  
Old November 5th, 2009, 02:36 PM
Registered User
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got the same problem. You have no location set in your emulator.

If you telnet into the emulator console as follows:

telnet localhost <console-port>

Then type the following command to set a default location:

geo fix -121.45356 46.51119 4392

Next time your run the example, it will pick up this location.

The (Android dev guide) has more information about setting locations.


Stephen
www.stephendowney.net/blog
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
run stalinn PHP How-To 0 March 7th, 2008 03:08 AM
How can I run or not run Google AD in my ASP.NET w mycwcgr ASP.NET 2.0 Professional 0 November 5th, 2007 07:18 AM
how to run servlet? suchi Pro JSP 1 July 1st, 2006 07:36 PM
Can't get any of the samples to run... cwerth BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 June 16th, 2006 07:26 PM
Run time Help Dazzer96 Access VBA 2 May 3rd, 2006 07:03 AM



All times are GMT -4. The time now is 06:10 AM.


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