haudegen07

Problems with the Hello World Map sample

Discussion created by haudegen07 on Apr 12, 2012
Latest reply on May 9, 2012 by aleruz
Hi,
I�??m new to ArcGIS for Android and have problems with the arcgis samples. When I try to launch the �??Hello World�?� Maps example on my android phone it always crashes.
I modified the MapView initExtent as shown in the help section here and tried it again without effect. All permissions and variables are set in the manifest.

Another example Viewshed is working out of the box on my phone.

Thanks,
Daniel


04-12 11:58:41.540: D/AndroidRuntime(4100): Shutting down VM
04-12 11:58:41.540: W/dalvikvm(4100): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
04-12 11:58:41.545: E/AndroidRuntime(4100): FATAL EXCEPTION: main
04-12 11:58:41.545: E/AndroidRuntime(4100): java.lang.VerifyError: com.esri.core.internal.b.a.b
04-12 11:58:41.545: E/AndroidRuntime(4100):  at com.esri.android.map.ags.ArcGISTiledMapServiceLayer.<init>(Unknown Source)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at com.esri.android.map.ags.ArcGISTiledMapServiceLayer.<init>(Unknown Source)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at com.esri.arcgis.android.samples.helloworld.HelloWorld.onCreate(HelloWorld.java:34)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.os.Looper.loop(Looper.java:130)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at android.app.ActivityThread.main(ActivityThread.java:3691)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at java.lang.reflect.Method.invokeNative(Native Method)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at java.lang.reflect.Method.invoke(Method.java:507)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
04-12 11:58:41.545: E/AndroidRuntime(4100):  at dalvik.system.NativeStart.main(Native Method)


Layout
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    
<!-- MapView layout and initial extent -->
<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
initExtent = "-1.3296373526814876E7 3930962.41823043 -1.2807176545789773E7 4201243.7502468005">
</com.esri.android.map.MapView>
   
</LinearLayout>


Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.esri.arcgis.android.samples.helloworld"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".HelloWorld"
                  android:label="@string/app_name"
                  android:configChanges="orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>


<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-sdk android:minSdkVersion="8" />
<uses-feature android:glEsVersion="0x00020000"
        android:required="true" />
</manifest> 


Java Class
package com.esri.arcgis.android.samples.helloworld;

import android.app.Activity;
import android.os.Bundle;

import com.esri.android.map.MapView;
import com.esri.android.map.ags.ArcGISDynamicMapServiceLayer;
import com.esri.android.map.ags.ArcGISTiledMapServiceLayer;

public class HelloWorld extends Activity {
 MapView map = null;

 /** Called when the activity is first created. */
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  // Retrieve the map and initial extent from XML layout
  map = (MapView)findViewById(R.id.map);
  // Add dynamic layer to MapView
  map.addLayer(new ArcGISTiledMapServiceLayer("" +
  "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));

 }

 protected void onPause() {
  super.onPause();
  map.pause();
 }

 protected void onResume() {
  super.onResume();
  map.unpause();
 }
 
}

Outcomes