{"id":7078,"date":"2014-05-19T04:12:34","date_gmt":"2014-05-19T04:12:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/19\/embedding-google-mapview-crashes-android-app-collection-of-common-programming-errors\/"},"modified":"2014-05-19T04:12:34","modified_gmt":"2014-05-19T04:12:34","slug":"embedding-google-mapview-crashes-android-app-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/19\/embedding-google-mapview-crashes-android-app-collection-of-common-programming-errors\/","title":{"rendered":"Embedding Google MapView crashes android app-Collection of common programming errors"},"content":{"rendered":"<p>model : zt180 firmware : android 2.1-update1-20101030 kernel : 2.6.32.9 usbandroid #1608 build number zt180-eng 2.1-update1 20101030 google maps : 4.5.1<\/p>\n<p>Various crashes occur when embedding the google maps component into an android application. I&#8217;m connecting to a router via wi-fi for internet access. The stand-alone google maps app seems to work fine. To re-produce, start the maps app and begin scrolling around.<\/p>\n<p>Will fail within a couple of minutes, occassionally on start-up (in setContentView). Most of the errors are when drawing tiles in google code. Sometimes just an Android SEGV.<\/p>\n<p>NOTE : I&#8217;ve tested the same app on the Android developer phone 2 (os 1.6) and it works fine.<\/p>\n<p>My android app is as follows:<\/p>\n<pre><code>\n\n\n\n\n\nimport com.google.android.maps.MapActivity;\nimport android.os.Bundle;\n\npublic class Maps extends MapActivity {  \n  public void onCreate(Bundle savedInstanceState) {  \n    super.onCreate(savedInstanceState);  \n    setContentView(R.layout.main);   \n  }  \n  protected boolean isRouteDisplayed() { return false; }  \n }  \n<\/code><\/pre>\n<p>=========================<\/p>\n<pre><code>W\/MapActivity( 2745): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher@45ebcd30\nV\/MapActivity( 2745): Recycling map object.\nI\/ActivityManager( 2010): Displayed activity com.brta.android.lite\/.Maps: 720 ms (total 720 ms)\nI\/MapActivity( 2745): Handling network change notification:CONNECTED\nE\/MapActivity( 2745): Couldn't get connection factory client\nD\/AndroidRuntime( 2745): Shutting down VM\nW\/dalvikvm( 2745): threadid=3: thread exiting with uncaught exception (group=0x4001b168)\nE\/AndroidRuntime( 2745): Uncaught handler: thread main exiting due to uncaught exception\nE\/AndroidRuntime( 2745): java.lang.IncompatibleClassChangeError: interface not implemented\nE\/AndroidRuntime( 2745): at com.google.googlenav.map.Map.checkPaintTimeExceeded(Unknown Source)\nE\/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)\nE\/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMap(Unknown Source)\nE\/AndroidRuntime( 2745): at com.google.android.maps.MapView.drawMap(MapView.java:1048)\nE\/AndroidRuntime( 2745): at com.google.android.maps.MapView.onDraw(MapView.java:486)\n\nI\/Process ( 2745): Sending signal. PID: 2745 SIG: 9\nI\/ActivityManager( 2010): Process com.brta.android.lite (pid 2745) has died.\nI\/WindowManager( 2010): WIN DEATH: Window{46112878 com.brta.android.lite\/com.brta.android.lite.Maps paused=false}\nI\/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.lite`\n<\/code><\/pre>\n<p>======================================================================<\/p>\n<pre><code>I\/MapActivity( 2863): Handling network change notification:CONNECTED\nE\/MapActivity( 2863): Couldn't get connection factory client\nD\/dalvikvm( 2863): GC freed 8114 objects \/ 577376 bytes in 86ms\nD\/dalvikvm( 2863): GC freed 685 objects \/ 444384 bytes in 85ms\nD\/dalvikvm( 2863): GC freed 3458 objects \/ 259456 bytes in 79ms\nI\/ActivityManager( 2010): Displayed activity com.brta.android.lite\/.Maps: 4407 ms (total 4407 ms)\nD\/AndroidRuntime( 2863): Shutting down VM\nW\/dalvikvm( 2863): threadid=3: thread exiting with uncaught exception (group=0x4001b168)\nE\/AndroidRuntime( 2863): Uncaught handler: thread main exiting due to uncaught exception\nE\/AndroidRuntime( 2863): java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0\nE\/AndroidRuntime( 2863): at java.util.Vector.elementAt(Vector.java:331)\nE\/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawTile(Unknown Source)\nE\/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)\nE\/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMap(Unknown Source)\nE\/AndroidRuntime( 2863): at com.google.android.maps.MapView.drawMap(MapView.java:1048)\nE\/AndroidRuntime( 2863): at com.google.android.maps.MapView.onDraw(MapView.java:486)\nE\/AndroidRuntime( 2863): at android.view.View.draw(View.java:6535)\nE\/AndroidRuntime( 2863): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)\nE\/AndroidRuntime( 2863): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)\n\nE\/AndroidRuntime( 2863): at dalvik.system.NativeStart.main(Native Method)\nI\/Process ( 2010): Sending signal. PID: 2863 SIG: 3\nI\/dalvikvm( 2863): threadid=7: reacting to signal 3\nI\/dalvikvm( 2863): Wrote stack trace to '\/data\/anr\/traces.txt'\nI\/Process ( 2863): Sending signal. PID: 2863 SIG: 9\nI\/WindowManager( 2010): WIN DEATH: Window{460ac708 com.brta.android.lite\/com.brta.android.lite.Maps paused=false}\nI\/ActivityManager( 2010): Process com.brta.android.lite (pid 2863) has died.\nI\/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.lite\nW\/InputManagerService( 2010): Got RemoteException sending setActive(false) notification to pid 2863 uid 10046\n<\/code><\/pre>\n<p>Basically, lots of bad things start happening..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>model : zt180 firmware : android 2.1-update1-20101030 kernel : 2.6.32.9 usbandroid #1608 build number zt180-eng 2.1-update1 20101030 google maps : 4.5.1 Various crashes occur when embedding the google maps component into an android application. I&#8217;m connecting to a router via wi-fi for internet access. The stand-alone google maps app seems to work fine. To re-produce, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7078","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7078"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7078\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}