Select to view content in your preferred language

How to add a service layer (point) in androind studio?

2954
1
11-06-2015 07:18 AM
Luis_AlejandroTorrez_Zapata
Deactivated User

hi people.

I am new in this, i want create a simple app in android studio, only a base map and a layer (points) no more. i have my layer in arcgis servere (http://190.181.6.106:6080/arcgis/rest/services/Sob/FC_APP/MapServer)

all ready I create an app whit a base map but i cant add my point layer, i saw this topic https://developers.arcgis.com/android/guide/access-feature-data-in-the-cloud.htm,  i use this sentence <string name="featureServiceURL">http://services.arcgis.com/oKgs2tbjK6zwTdvi/arcgis/rest/services/Major_World_Cities/FeatureServer/0</string> in strings.xml, is this the way?

i realy dont know how to do, i am trying 3 days and i cant.

like i said i just need a base map plus my point layer, no more

can you help me plz

0 Kudos
1 Reply
DanO_Neill
Deactivated User

Your Map Service of Points is a dynamic layer so you need to add it in as an ArcGISDynamicMapServiceLayer.  A better sample app to get started with is the Hello World sample.  You can add your layer to this app by adding the following code snippet to MainActivity.java​:

mMapView = (MapView)findViewById(R.id.map);
// add the following code below
ArcGISDynamicMapServiceLayer pointLayer = new ArcGISDynamicMapServiceLayer("http://190.181.6.106:6080/arcgis/rest/services/Sob/FC_APP/MapServer");
mMapView.addLayer(pointLayer);

Next update the MapView layout resource, activity_main.xml, to your area of interest with the following:

mapoptions.center="-13.894009, -64.962861"

mapoptions.ZoomLevel="10"

Your map should look similar to the following screenshot: 

dynamic_layer.png

0 Kudos