Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old June 2nd, 2010, 08:59 AM
Registered User
 
Join Date: Jun 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by w_darryl View Post
I found the logcat information pane finally under window->show view->logcat. Why that is not in the help is beyond me.

At any rate, here is the log I am getting when I try to run it on my device. My device, BTW, is a Nexus One with Android 2.1 update1 running on it.

04-09 10:48:35.213: WARN/WindowManager(52): Key dispatching timed out sending to <null>
04-09 10:48:35.213: WARN/WindowManager(52): Dispatch state: null
04-09 10:48:35.213: INFO/WindowManager(52): focus null mToken is null at event dispatch!
...
@w_darryl, you should include the part of the log where it has ERROR messages.
I think these warnings are not the cause of the Force Quit.
  #12 (permalink)  
Old June 2nd, 2010, 09:13 AM
Registered User
 
Join Date: Jun 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

BTW: the emulator has no Bluetooth support ;-)
see the limitations at http://developer.android.com/guide/d.../emulator.html
  #13 (permalink)  
Old October 31st, 2010, 03:42 PM
Registered User
 
Join Date: Jul 2010
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Reto,

Thanks for your post on April 7th regarding Line 191 of the EarthquakeProvider class (introduced on Page 232) has a superfluous ")". That helped me get Chapter 10 Earthquake 3 running.

But in the Earthquake menu when I select "Earthquake Map" I get a white screen with red dots on it. I don't get a nice map as shown on http://blog.radioactiveyak.com/2010/...arthquake.html

Is this a known problem? I have been googling for a solution but can't find one.

Vince
  #14 (permalink)  
Old November 4th, 2010, 06:28 PM
Registered User
 
Join Date: Jul 2010
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Reto,

In logcat I got this message when trying to view an Earthquake Map:
"failed to find provider infor com.google.settings"

I googled the logcat message and learned about Android Maps API Key Signup.

After reading your book a bit more my Earthquake Map problem is solved in section "Getting Your Maps API key"

Now I get a nice earthquake map on the emulator and Nexus One.

Thanks! Great book!

Vince
  #15 (permalink)  
Old March 23rd, 2011, 06:07 PM
Registered User
 
Join Date: Mar 2011
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Dude as of March 2011 this is still not fixed in the code?

Edit: Well the bug was still in Chapter 7 Earthquake 2

Last edited by schmide; March 23rd, 2011 at 06:37 PM..
  #16 (permalink)  
Old September 19th, 2011, 03:43 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Reto View Post
Thanks!

There's a typo that somehow managed to sneak through in both the code and the examples.

Line 191 of the EarthquakeProvider class (introduced on Page 232) has a superfluous ")". It should read:

Code:
+ KEY_MAGNITUDE + " FLOAT, "
NOT

Code:
+ KEY_MAGNITUDE + " FLOAT), "
I'll update the downloadable code samples ASAP and add this to the book's errata page. Thanks for letting me know!
Whew..thanks for this..the widget example was driving me nuts....works beautifully now...
  #17 (permalink)  
Old December 4th, 2012, 10:07 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default problems running chapter 9, part 4

Hello, has anyone encountered the following problem:

12-04 14:47:14.458: W/KeyCharacterMap(248): No keyboard for id 0
12-04 14:47:14.470: W/KeyCharacterMap(248): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
12-04 14:47:30.168: E/ActivityThread(248): Failed to find provider info for com.google.settings
12-04 14:47:30.178: E/ActivityThread(248): Failed to find provider info for com.google.settings
12-04 14:47:30.208: E/ActivityThread(248): Failed to find provider info for com.google.settings
12-04 14:47:30.408: D/dalvikvm(248): GC freed 12927 objects / 648880 bytes in 112ms
12-04 14:47:30.408: I/dalvikvm(248): Uncaught exception thrown by finalizer (will be discarded):
12-04 14:47:30.408: I/dalvikvm(248): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@44ea14a0 on earthquakes that has not been deactivated or closed
12-04 14:47:30.408: I/dalvikvm(248): at android.database.sqlite.SQLiteCursor.finalize(SQLi teCursor.java:596)
12-04 14:47:30.408: I/dalvikvm(248): at dalvik.system.NativeStart.run(Native Method)
12-04 14:47:30.448: I/dalvikvm(248): Uncaught exception thrown by finalizer (will be discarded):
12-04 14:47:30.488: I/dalvikvm(248): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@44efa630 on earthquakes that has not been deactivated or closed
12-04 14:47:30.488: I/dalvikvm(248): at android.database.sqlite.SQLiteCursor.finalize(SQLi teCursor.java:596)
12-04 14:47:30.488: I/dalvikvm(248): at dalvik.system.NativeStart.run(Native Method)
12-04 14:47:30.498: I/dalvikvm(248): Uncaught exception thrown by finalizer (will be discarded):
12-04 14:47:30.498: I/dalvikvm(248): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@44f2d418 on earthquakes that has not been deactivated or closed
12-04 14:47:30.498: I/dalvikvm(248): at android.database.sqlite.SQLiteCursor.finalize(SQLi teCursor.java:596)
12-04 14:47:30.498: I/dalvikvm(248): at dalvik.system.NativeStart.run(Native Method)
12-04 14:47:30.708: I/MapActivity(248): Handling network change notification:CONNECTED
12-04 14:47:30.720: E/MapActivity(248): Couldn't get connection factory client
12-04 14:47:31.030: D/dalvikvm(248): GC freed 6877 objects / 414920 bytes in 82ms
12-04 14:47:32.307: D/dalvikvm(248): GC freed 9500 objects / 679472 bytes in 88ms
12-04 14:47:32.867: D/dalvikvm(248): GC freed 313 objects / 40944 bytes in 103ms
12-04 14:47:33.097: D/dalvikvm(248): GC freed 63 objects / 21368 bytes in 87ms
12-04 14:47:33.397: D/dalvikvm(248): GC freed 2675 objects / 126624 bytes in 92ms
12-04 14:47:35.827: D/dalvikvm(248): GC freed 95 objects / 40784 bytes in 97ms
12-04 14:47:38.219: D/dalvikvm(248): GC freed 94 objects / 40928 bytes in 91ms
12-04 14:47:40.838: D/dalvikvm(248): GC freed 1476 objects / 101592 bytes in 80ms
12-04 14:47:42.778: D/dalvikvm(248): GC freed 1228 objects / 128096 bytes in 92ms
12-04 14:47:45.208: D/dalvikvm(248): GC freed 106 objects / 42920 bytes in 91ms
12-04 14:47:47.658: D/dalvikvm(248): GC freed 333 objects / 52712 bytes in 97ms
12-04 14:47:50.038: D/dalvikvm(248): GC freed 98 objects / 43856 bytes in 91ms
12-04 14:47:52.488: D/dalvikvm(248): GC freed 324 objects / 52824 bytes in 87ms
12-04 14:47:54.928: D/dalvikvm(248): GC freed 90 objects / 43280 bytes in 101ms
12-04 14:47:59.248: D/dalvikvm(248): GC freed 2086 objects / 101944 bytes in 87ms
12-04 14:48:03.048: D/dalvikvm(248): GC freed 2537 objects / 106312 bytes in 86ms
12-04 14:48:05.489: D/dalvikvm(248): GC freed 611 objects / 64592 bytes in 88ms
12-04 14:48:07.907: D/dalvikvm(248): GC freed 571 objects / 62360 bytes in 103ms
12-04 14:48:10.329: D/dalvikvm(248): GC freed 116 objects / 44392 bytes in 84ms
12-04 14:48:15.478: I/MapActivity(248): Handling network change notification:CONNECTED
12-04 14:48:16.118: D/dalvikvm(248): GC freed 493 objects / 59992 bytes in 89ms
12-04 14:48:17.838: W/KeyCharacterMap(248): No keyboard for id 0
12-04 14:48:17.838: W/KeyCharacterMap(248): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
12-04 14:48:18.568: D/dalvikvm(248): GC freed 113 objects / 44376 bytes in 96ms
12-04 14:48:20.978: D/dalvikvm(248): GC freed 96 objects / 43784 bytes in 98ms
12-04 14:48:21.068: W/KeyCharacterMap(248): No keyboard for id 0
12-04 14:48:21.068: W/KeyCharacterMap(248): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
12-04 14:48:23.568: D/dalvikvm(248): GC freed 128 objects / 44544 bytes in 112ms
12-04 14:48:26.128: D/dalvikvm(248): GC freed 770 objects / 67792 bytes in 91ms
12-04 14:48:47.918: I/MapActivity(248): Handling network change notification:CONNECTED
12-04 14:48:50.169: W/KeyCharacterMap(248): No keyboard for id 0
12-04 14:48:50.178: W/KeyCharacterMap(248): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
12-04 14:48:51.018: D/dalvikvm(248): threadid=25 wakeup: interrupted
12-04 14:48:51.058: E/ActivityThread(248): Activity com.paad.earthquake.EarthquakeMap has leaked IntentReceiver com.paad.earthquake.EarthquakeMap$EarthquakeReceiv er@44ef67d0 that was originally registered here. Are you missing a call to unregisterReceiver()?
12-04 14:48:51.058: E/ActivityThread(248): android.app.IntentReceiverLeaked: Activity com.paad.earthquake.EarthquakeMap has leaked IntentReceiver com.paad.earthquake.EarthquakeMap$EarthquakeReceiv er@44ef67d0 that was originally registered here. Are you missing a call to unregisterReceiver()?
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ActivityThread$PackageInfo$ReceiverDis patcher.<init>(ActivityThread.java:797)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ActivityThread$PackageInfo.getReceiver Dispatcher(ActivityThread.java:608)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiverInt ernal(ApplicationContext.java:724)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiver(Ap plicationContext.java:711)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiver(Ap plicationContext.java:705)
12-04 14:48:51.058: E/ActivityThread(248): at android.content.ContextWrapper.registerReceiver(Co ntextWrapper.java:308)
12-04 14:48:51.058: E/ActivityThread(248): at com.paad.earthquake.EarthquakeMap.onResume(Earthqu akeMap.java:51)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.Instrumentation.callActivityOnResume(I nstrumentation.java:1149)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.Activity.performResume(Activity.java:3 763)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ActivityThread.performResumeActivity(A ctivityThread.java:2937)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ActivityThread.handleResumeActivity(Ac tivityThread.java:2965)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1889)
12-04 14:48:51.058: E/ActivityThread(248): at android.os.Handler.dispatchMessage(Handler.java:99 )
12-04 14:48:51.058: E/ActivityThread(248): at android.os.Looper.loop(Looper.java:123)
12-04 14:48:51.058: E/ActivityThread(248): at android.app.ActivityThread.main(ActivityThread.jav a:4363)
12-04 14:48:51.058: E/ActivityThread(248): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 14:48:51.058: E/ActivityThread(248): at java.lang.reflect.Method.invoke(Method.java:521)
12-04 14:48:51.058: E/ActivityThread(248): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:860)
12-04 14:48:51.058: E/ActivityThread(248): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:618)
12-04 14:48:51.058: E/ActivityThread(248): at dalvik.system.NativeStart.main(Native Method)
12-04 14:48:51.078: E/ActivityThread(248): Activity com.paad.earthquake.EarthquakeMap has leaked IntentReceiver com.paad.earthquake.EarthquakeMap$EarthquakeReceiv er@44f4f6f8 that was originally registered here. Are you missing a call to unregisterReceiver()?
12-04 14:48:51.078: E/ActivityThread(248): android.app.IntentReceiverLeaked: Activity com.paad.earthquake.EarthquakeMap has leaked IntentReceiver com.paad.earthquake.EarthquakeMap$EarthquakeReceiv er@44f4f6f8 that was originally registered here. Are you missing a call to unregisterReceiver()?
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread$PackageInfo$ReceiverDis patcher.<init>(ActivityThread.java:797)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread$PackageInfo.getReceiver Dispatcher(ActivityThread.java:608)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiverInt ernal(ApplicationContext.java:724)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiver(Ap plicationContext.java:711)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiver(Ap plicationContext.java:705)
12-04 14:48:51.078: E/ActivityThread(248): at android.content.ContextWrapper.registerReceiver(Co ntextWrapper.java:308)
12-04 14:48:51.078: E/ActivityThread(248): at com.paad.earthquake.EarthquakeMap.onResume(Earthqu akeMap.java:51)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.Instrumentation.callActivityOnResume(I nstrumentation.java:1149)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.Activity.performResume(Activity.java:3 763)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread.performResumeActivity(A ctivityThread.java:2937)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread.handleResumeActivity(Ac tivityThread.java:2965)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2516)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread.access$2200(ActivityThr ead.java:119)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1863)
12-04 14:48:51.078: E/ActivityThread(248): at android.os.Handler.dispatchMessage(Handler.java:99 )
12-04 14:48:51.078: E/ActivityThread(248): at android.os.Looper.loop(Looper.java:123)
12-04 14:48:51.078: E/ActivityThread(248): at android.app.ActivityThread.main(ActivityThread.jav a:4363)
12-04 14:48:51.078: E/ActivityThread(248): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 14:48:51.078: E/ActivityThread(248): at java.lang.reflect.Method.invoke(Method.java:521)
12-04 14:48:51.078: E/ActivityThread(248): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:860)
12-04 14:48:51.078: E/ActivityThread(248): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:618)
12-04 14:48:51.078: E/ActivityThread(248): at dalvik.system.NativeStart.main(Native Method)
12-04 14:48:51.108: E/ActivityThread(248): Activity com.paad.earthquake.EarthquakeMap has leaked IntentReceiver com.paad.earthquake.EarthquakeMap$EarthquakeReceiv er@44ef6e38 that was originally registered here. Are you missing a call to unregisterReceiver()?
12-04 14:48:51.108: E/ActivityThread(248): android.app.IntentReceiverLeaked: Activity com.paad.earthquake.EarthquakeMap has leaked IntentReceiver com.paad.earthquake.EarthquakeMap$EarthquakeReceiv er@44ef6e38 that was originally registered here. Are you missing a call to unregisterReceiver()?
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ActivityThread$PackageInfo$ReceiverDis patcher.<init>(ActivityThread.java:797)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ActivityThread$PackageInfo.getReceiver Dispatcher(ActivityThread.java:608)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiverInt ernal(ApplicationContext.java:724)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiver(Ap plicationContext.java:711)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ApplicationContext.registerReceiver(Ap plicationContext.java:705)
12-04 14:48:51.108: E/ActivityThread(248): at android.content.ContextWrapper.registerReceiver(Co ntextWrapper.java:308)
12-04 14:48:51.108: E/ActivityThread(248): at com.paad.earthquake.EarthquakeMap.onResume(Earthqu akeMap.java:51)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.Instrumentation.callActivityOnResume(I nstrumentation.java:1149)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.Activity.performResume(Activity.java:3 763)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ActivityThread.performResumeActivity(A ctivityThread.java:2937)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ActivityThread.handleResumeActivity(Ac tivityThread.java:2965)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1889)
12-04 14:48:51.108: E/ActivityThread(248): at android.os.Handler.dispatchMessage(Handler.java:99 )
12-04 14:48:51.108: E/ActivityThread(248): at android.os.Looper.loop(Looper.java:123)
12-04 14:48:51.108: E/ActivityThread(248): at android.app.ActivityThread.main(ActivityThread.jav a:4363)
12-04 14:48:51.108: E/ActivityThread(248): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 14:48:51.108: E/ActivityThread(248): at java.lang.reflect.Method.invoke(Method.java:521)
12-04 14:48:51.108: E/ActivityThread(248): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:860)
12-04 14:48:51.108: E/ActivityThread(248): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:618)
12-04 14:48:51.108: E/ActivityThread(248): at dalvik.system.NativeStart.main(Native Method)
12-04 14:50:25.858: W/Resources(248): Converting to string: TypedValue{t=0x10/d=0x3c a=-1}
12-04 14:50:25.868: W/Resources(248): Converting to string: TypedValue{t=0x10/d=0x3 a=-1}
12-04 14:50:25.928: D/(248): unable to unlink '/data/data/com.paad.earthquake/shared_prefs/com.paad.earthquake_preferences.xml.bak': No such file or directory (errno=2)
12-04 14:50:55.408: D/dalvikvm(248): GC freed 11861 objects / 763808 bytes in 102ms
12-04 14:50:55.518: I/dalvikvm(248): Uncaught exception thrown by finalizer (will be discarded):
12-04 14:50:55.518: I/dalvikvm(248): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@44ee4ef0 on earthquakes that has not been deactivated or closed
12-04 14:50:55.518: I/dalvikvm(248): at android.database.sqlite.SQLiteCursor.finalize(SQLi teCursor.java:596)
12-04 14:50:55.528: I/dalvikvm(248): at dalvik.system.NativeStart.run(Native Method)
12-04 14:50:55.658: I/dalvikvm(248): Uncaught exception thrown by finalizer (will be discarded):
12-04 14:50:55.658: I/dalvikvm(248): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@44f3af48 on earthquakes that has not been deactivated or closed
12-04 14:50:55.658: I/dalvikvm(248): at android.database.sqlite.SQLiteCursor.finalize(SQLi teCursor.java:596)
12-04 14:50:55.658: I/dalvikvm(248): at dalvik.system.NativeStart.run(Native Method)
12-04 14:50:58.478: W/KeyCharacterMap(248): No keyboard for id 0
12-04 14:50:58.488: W/KeyCharacterMap(248): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
12-04 14:51:01.898: E/ActivityThread(248): Failed to find provider info for com.google.settings
12-04 14:51:01.898: E/ActivityThread(248): Failed to find provider info for com.google.settings
12-04 14:51:01.898: W/MapActivity(248): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispat cher@44f1e2e8
12-04 14:51:01.937: V/MapActivity(248): Recycling map object.
12-04 14:51:02.067: I/MapActivity(248): Handling network change notification:CONNECTED
12-04 14:51:02.067: E/MapActivity(248): Couldn't get connection factory client
12-04 14:51:29.498: D/dalvikvm(248): GC freed 12409 objects / 645328 bytes in 118ms
12-04 14:51:29.535: I/dalvikvm(248): Uncaught exception thrown by finalizer (will be discarded):
12-04 14:51:29.535: I/dalvikvm(248): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@44fd9660 on earthquakes that has not been deactivated or closed
12-04 14:51:29.538: I/dalvikvm(248): at android.database.sqlite.SQLiteCursor.finalize(SQLi teCursor.java:596)
12-04 14:51:29.538: I/dalvikvm(248): at dalvik.system.NativeStart.run(Native Method)
12-04 14:51:33.580: D/dalvikvm(248): GC freed 3254 objects / 166888 bytes in 80ms
12-04 14:51:36.008: D/dalvikvm(248): GC freed 137 objects / 44232 bytes in 108ms
12-04 14:51:38.417: D/dalvikvm(248): GC freed 97 objects / 43984 bytes in 91ms


I point out that I have generated my maps key, there are some problems with the usability of the app, e.g. I see the red dots on the map but I cannot zoom the map, or when I switch between activities I can only use the esc tab to do so, is that normal?
  #18 (permalink)  
Old December 7th, 2012, 05:14 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 9 Earthquake example code problem

Hi,
I download code example from wrox site and import Chapter 9 Earthquake (2, 3, 4 all same result) and do

1. set Build target to Google APIs (Android 2.1)
2. change EarthquakeProvider.java
" + KEY_MAGNITUDE + " FLOAT), "
to
" + KEY_MAGNITUDE + " FLOAT, "
3. run -> Debug
4. result is Earthquake not response and force close.
5. logcat error show
Code:
12-07 10:14:44.607: E/AndroidRuntime(209): Uncaught handler: thread main exiting due to uncaught exception
12-07 10:14:44.737: E/AndroidRuntime(209): java.lang.RuntimeException: Unable to start service com.paad.earthquake.EarthquakeService@43baf6d0 with Intent { cmp=com.paad.earthquake/.EarthquakeService }: java.lang.ClassCastException: java.lang.String
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2882)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.app.ActivityThread.access$3500(ActivityThread.java:119)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.os.Handler.dispatchMessage(Handler.java:99)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.os.Looper.loop(Looper.java:123)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.app.ActivityThread.main(ActivityThread.java:4363)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at java.lang.reflect.Method.invokeNative(Native Method)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at java.lang.reflect.Method.invoke(Method.java:521)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at dalvik.system.NativeStart.main(Native Method)
12-07 10:14:44.737: E/AndroidRuntime(209): Caused by: java.lang.ClassCastException: java.lang.String
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.app.ApplicationContext$SharedPreferencesImpl.getInt(ApplicationContext.java:2579)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at com.paad.earthquake.EarthquakeService.onStartCommand(EarthquakeService.java:50)
12-07 10:14:44.737: E/AndroidRuntime(209): 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2873)
12-07 10:14:44.737: E/AndroidRuntime(209): 	... 10 more
After modify "+ KEY_MAGNITUDE + " FLOAT), " to + "KEY_MAGNITUDE + " FLOAT, " Chapter 8 program running OK but Chapter 9 (all version, chapter 10 etc.) still have problem.

Could you check and update?

By the way code example for Android 4 book is OK. But for Android 2 I can not get it run.
Thank you,

Lin2012




Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to run Chapter 2 Example tkachuk BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 6 August 2nd, 2009 11:37 PM
LINQ: Chapter 13, the first example cannot be run clark BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 January 15th, 2009 08:41 AM
Missing Source Code for Chapters 2-10, 12, 13, 15? haroldbingo BOOK: Beginning JavaServer Pages 5 February 16th, 2008 11:32 AM
How to run the chapter 10 (acegi) sample code? dleal BOOK: Professional Java Development with the Spring Framework 0 June 28th, 2006 10:50 AM
unable to run ch 10 examples jgtez JSP Basics 0 February 24th, 2004 09:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.