0

I have a problem with GoogleWrapperSample for OpenSteetMap (I use osmdroid latest jar - 3.0.8). It is compiling fine, but the emulator (Google API 2.2 device) throws a toast with "Activity is not responding" message and nothing else. There are no errors/warnings and as it is a logger in osmdroid classes I can only receive some logging information. LogCat gives something like this:

02-14 13:21:20.246: W/System.err(968): 38 [main] INFO org.osmdroid.views.MapView - Using tile source: org.osmdroid.tileprovider.tilesource.XYTileSource@44eb5260
02-14 13:21:20.316: W/System.err(968): 113 [main] INFO org.osmdroid.tileprovider.modules.MapTileFileStorageProviderBase - sdcard state: mounted
02-14 13:21:20.336: W/System.err(968): 129 [main] INFO org.osmdroid.tileprovider.modules.MapTileFileStorageProviderBase - sdcard state: mounted
02-14 13:21:30.166: I/dalvikvm(968): threadid=3: reacting to signal 3
02-14 13:21:30.207: I/dalvikvm(968): Wrote stack traces to '/data/anr/traces.txt'

Has anyone got this sample working? I have no ideas how to solve this problem.

Maybe, it is somehow connected with getting OSM tiles via network or something like that - we have a proxy connection so https and SSL port are not available (but all in all network on the device is ok).

UPD.
On HTC Desire it works properly but OSM map is not available - there is only a grid. On the other hand, Google map is ok.
LogCat contains this:

02-15 14:47:00.074: W/System.err(2106): 6 [main] INFO org.osmdroid.views.MapView - Using tile source: org.osmdroid.tileprovider.tilesource.XYTileSource@46361618
02-15 14:47:00.084: W/System.err(2106): 23 [main] INFO org.osmdroid.tileprovider.modules.MapTileFileStorageProviderBase - sdcard state: mounted
02-15 14:47:00.094: W/System.err(2106): 26 [main] INFO org.osmdroid.tileprovider.modules.MapTileFileStorageProviderBase - sdcard state: mounted
02-15 14:47:00.184: D/dalvikvm(2106): GC_FOR_MALLOC freed 4349 objects / 315536 bytes in 33ms
02-15 14:47:00.214: D/dalvikvm(2106): GC_EXTERNAL_ALLOC freed 317 objects / 14952 bytes in 28ms
02-15 14:47:00.224: W/System.err(2106): 160 [main] INFO org.osmdroid.tileprovider.MapTileProviderBase - rescale tile cache from 0 to 14
02-15 14:47:00.234: W/System.err(2106): 170 [main] INFO org.osmdroid.tileprovider.MapTileProviderBase - Finished rescale in 10ms
02-15 14:47:00.284: I/MapActivity(2106): Handling network change notification:CONNECTED
02-15 14:47:00.284: E/MapActivity(2106): Couldn't get connection factory client

On emulator there is no progress. I think that "Couldn't get connection factory client" is the reason of my problem but have no idea about the way to fix this.

Jane
  • 21
  • 4

1 Answers1

1

There are two situations where an Application Not Responding (ANR) may occur:

  1. No response to an input event (e.g. key press, screen touch) within 5 seconds.
  2. A BroadcastReceiver hasn't finished executing within 10 seconds.

Common causes of an ANR are (stalled) networking operations or expensive calculations. There are a number of posts on SO on how to solve it (e.g. here or here), but the biggest help is probably the Android API.

I took a quick look at the sample code, I'm not sure but perhaps the setMapView() method that is called in onResume() takes too long. You may be able to test this by commenting that line out. Otherwise, check the traces.txt file on the emulator for clues and/or add logging statements to your code to pinpoint which operation is taking too long.

As for your "Couldn't get connection factory client" error, that question has already been answered here

Community
  • 1
  • 1
THelper
  • 15,333
  • 6
  • 64
  • 104
  • Thanks for the first part of your answer, there were some problems with networking operation as on HTC now it works ok. – Jane Mar 05 '12 at 05:58