I tried the Hello World code from ArcGIS android SDK and followed all the steps but the map doesn't appear and instead I get a black mapview.
Here is the java code :
package com.example.user.arcgismap; import android.app.Activity; import android.os.Bundle; import com.esri.android.map.MapView; public class MainActivity extends Activity { MapView mMapView; // Called when the activity is first created. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.content_main); // After the content of this Activity is set, the map can be accessed programmatically from the layout. mMapView = (MapView) findViewById(R.id.map); } @Override protected void onPause() { super.onPause(); // Call MapView.pause to suspend map rendering while the activity is paused, which can save battery usage. if (mMapView != null) { mMapView.pause(); } } @Override protected void onResume() { super.onResume(); // Call MapView.unpause to resume map rendering when the activity returns to the foreground. if (mMapView != null) { mMapView.unpause(); } } } and here is the xml layout :
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context="com.example.user.arcgismap.MainActivity" tools:showIn="@layout/activity_main"> <com.esri.android.map.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" mapoptions.MapType="streets" mapoptions.center="34.056215, -117.195668," mapoptions.ZoomLevel="16"> </com.esri.android.map.MapView> </RelativeLayout> can anyone help, what am I doing wrong ?
No comments:
Post a Comment