import android.app.Activity; import android.os.Bundle; import com.esri.android.map.MapView; import com.esri.android.map.ags.ArcGISDynamicMapServiceLayer; public class MyPath_v02Activity extends Activity { MapView mMapView = null; private ArcGISDynamicMapServiceLayer dynamicLayer; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mMapView = (MapView)findViewById(R.id.map); dynamicLayer = new ArcGISDynamicMapServiceLayer("http://anc-arcsrv-01.ua.ad.alaska.edu/arcgis/services/myPath_v8/MapServer/MobileServer"); mMapView.addLayer(dynamicLayer); } @Override protected void onDestroy() { super.onDestroy(); } @Override protected void onPause() { super.onPause(); mMapView.pause(); } @Override protected void onResume() { super.onResume(); mMapView.unpause(); } }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".MyPath_v02Activity" > <com.esri.android.map.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" initExtent = " -16713385.63038, 8560546.73163, -16546828.73922, 8746032.94837"> </com.esri.android.map.MapView> </LinearLayout>
Solved! Go to Solution.
I can add the service for the MapServer to ArcGIS Desktop and to ArcGIS Online with the URL "http://anc-arcsrv-01.ua.ad.alaska.edu/arcgis/services/myPath_v8/MapServer" and every thing works fine. However I'm uncertain how to test the URL for MobileServer service at "http://anc-arcsrv-01.ua.ad.alaska.edu/arcgis/services/myPath_v8/MapServer/MobileServer"
10-29 16:53:11.772: E/ArcGIS(16652): url =http://anc-arcsrv-01.ua.ad.alaska.edu/arcgis/services/myPath_v8/MapServer/MobileServer 10-29 16:53:11.772: E/ArcGIS(16652): org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') 10-29 16:53:11.772: E/ArcGIS(16652): at [Source: java.io.StringReader@40560848; line: 1, column: 2] 10-29 16:53:11.772: E/ArcGIS(16652): at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1432) 10-29 16:53:11.772: E/ArcGIS(16652): at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521) 10-29 16:53:11.772: E/ArcGIS(16652): at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442) 10-29 16:53:11.772: E/ArcGIS(16652): at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1198) 10-29 16:53:11.772: E/ArcGIS(16652): at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:485) 10-29 16:53:11.772: E/ArcGIS(16652): at com.esri.core.internal.b.a.g.a(Unknown Source) 10-29 16:53:11.772: E/ArcGIS(16652): at com.esri.core.internal.b.a.g.a(Unknown Source) 10-29 16:53:11.772: E/ArcGIS(16652): at com.esri.core.internal.a.a.n.b(Unknown Source) 10-29 16:53:11.772: E/ArcGIS(16652): at com.esri.android.map.ags.ArcGISDynamicMapServiceLayer.initLayer(Unknown Source) 10-29 16:53:11.772: E/ArcGIS(16652): at com.esri.android.map.ags.ArcGISDynamicMapServiceLayer$1.run(Unknown Source) 10-29 16:53:11.772: E/ArcGIS(16652): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:444) 10-29 16:53:11.772: E/ArcGIS(16652): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306) 10-29 16:53:11.772: E/ArcGIS(16652): at java.util.concurrent.FutureTask.run(FutureTask.java:138) 10-29 16:53:11.772: E/ArcGIS(16652): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) 10-29 16:53:11.772: E/ArcGIS(16652): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) 10-29 16:53:11.772: E/ArcGIS(16652): at java.lang.Thread.run(Thread.java:1027)
[2012-10-29 16:52:59 - MyPath_v02] ------------------------------ [2012-10-29 16:52:59 - MyPath_v02] Android Launch! [2012-10-29 16:52:59 - MyPath_v02] adb is running normally. [2012-10-29 16:52:59 - MyPath_v02] Performing forest.knutsen.ccel.uaa.geomatics.MyPath_v02Activity activity launch [2012-10-29 16:52:59 - MyPath_v02] Automatic Target Mode: using device 'HT1AXT203453' [2012-10-29 16:52:59 - MyPath_v02] Uploading MyPath_v02.apk onto device 'HT1AXT203453' [2012-10-29 16:53:04 - MyPath_v02] Installing MyPath_v02.apk... [2012-10-29 16:53:11 - MyPath_v02] Success! [2012-10-29 16:53:11 - MyPath_v02] Starting activity forest.knutsen.ccel.uaa.geomatics.MyPath_v02Activity on device HT1AXT203453 [2012-10-29 16:53:12 - MyPath_v02] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=forest.knutsen.ccel.uaa.geomatics/.MyPath_v02Activity }
I can add the service for the MapServer to ArcGIS Desktop and to ArcGIS Online with the URL "http://anc-arcsrv-01.ua.ad.alaska.edu/arcgis/services/myPath_v8/MapServer" and every thing works fine. However I'm uncertain how to test the URL for MobileServer service at "http://anc-arcsrv-01.ua.ad.alaska.edu/arcgis/services/myPath_v8/MapServer/MobileServer"