Displaying a map from my Mobile Server

705
3
Jump to solution
07-06-2012 06:43 AM
NicoTek
New Contributor III
Hello Everyone,

I'm new to the ArcGIS Android SDK.

I'm trying to display one of the maps I have in a ArcGIS Mobile Server.

When I use the esri arcGIS app from the Android Playstore I can connect to my server and see the map easily, but I would like to create my own app so that people don't have to enter my server info.

Any pointers or tips are greatly appreciated.

Thanks
Nico
0 Kudos
1 Solution

Accepted Solutions
NicoTek
New Contributor III
I was able to display the map layers that were hosted in the mobile server by creating a DynamicMapServiceLayer.

Here is a small code snippet where I create two layers. the first one is the esri base map and the second one is my layer from the mobile server where I make visible the layers 0,1,2

 public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   map = new MapView(this);      ArcGISTiledMapServiceLayer basemap = new ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");   map.addLayer(basemap);   ArcGISDynamicMapServiceLayer layer = new ArcGISDynamicMapServiceLayer("my_mobile_server_url/MapServer",new int[] {0,1,2});   map.addLayer(layer); 

View solution in original post

0 Kudos
3 Replies
Town_ofSnowflake
Occasional Contributor
Are you wanting to create a native Android Application? If so, I'd recommend checking out the videos from the Developers conference.  Here is a link to all the Android videos: http://video.esri.com/search/android
0 Kudos
NicoTek
New Contributor III
@MeloKing I'm trying to create an android application and The videos looks like a great place to start... Thanks!
0 Kudos
NicoTek
New Contributor III
I was able to display the map layers that were hosted in the mobile server by creating a DynamicMapServiceLayer.

Here is a small code snippet where I create two layers. the first one is the esri base map and the second one is my layer from the mobile server where I make visible the layers 0,1,2

 public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   map = new MapView(this);      ArcGISTiledMapServiceLayer basemap = new ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");   map.addLayer(basemap);   ArcGISDynamicMapServiceLayer layer = new ArcGISDynamicMapServiceLayer("my_mobile_server_url/MapServer",new int[] {0,1,2});   map.addLayer(layer); 
0 Kudos