Developing applications using the Mobile SDK  

Developing Mobile Applications


The ArcGIS Server Mobile SDK is a software development kit (SDK) for the Microsoft .NET framework that you can use to build highly focused Mobile GIS applications. Mobile GIS applications enable field workers to display, inspect, capture, and update geographic information in the field. Applications that you develop using the Mobile SDK use maps that are authored in ArcGIS Desktop and published as map resources using ArcGIS Server to distribute and synchronize geographic information to a range of supported mobile device platforms.

Mobile GIS Applications

Traditionally, spatial information has been taken to the field using paper maps, often in the form of map books. Information collected with a map book in the field is sketched on top of the paper map using pen or pencil and then entered into a GIS or CAD system when the field worker returns to the office. Field inspections are often done using reporting forms that are taken to the field on paper, filled out on a clipboard and then entered into a database upon return to the office. The re-entry of information captured on paper is not only cost prohibitive, but prone to error. Some organizations have started to remove paper based systems and replace them with software applications running on mobile devices. Quite often though, a generic mobile application is purchased. Generic mobile GIS applications generalize software functionality so that it can be applied to a variety of field editing workflows. This approach requires an analysis of how to accomplish your field workflows using functionality that was developed for everyone, extensive training the field worker, and support for an application that you do not build and maintain. Most generic applications also require that you check data out of the database into a different format and the check it back in when you return to the office. 

Using the ArcGIS Server Mobile technology, you can now build highly focused Mobile GIS applications that you design with a specific field workflow in mind and that synchronize changes directly with the geodatabase while connected in the field. Focused applications require little to no training for the field worker and can use the terminology that they use in the field today. You can grow and release functionality at your own pace based upon enhancements and changes to field workflows.

There are a wide range of applications that you can create using the ArcGIS Mobile SDK. Some examples include:

Field Viewing Application - take your spatial information to the field to help you make better decisions. A simple viewing application that can query asset information using a map will add value to the decisions you make in the field. By adding navigational support using the GPS component you can ensure that the location and information you are working with is accurate. Add the ability to report location to the office by storing GPS location in an editable layer and you can build an operational picture for your field workforce.

Field Inspections - field crews inspect assets in the field (transformers, water meters, street signs, etc). They report their condition, operational status, often take a picture of the asset and use GPS to improve its locational accuracy. Using the Mobile SDK components and Visual Studio .NET you can quickly build an inspection application that will accomplish these tasks. You can use the Mobile SDK and ADO.NET to bind geodatabase domain values directly to controls on an inspection form and eliminate the potential for error in entering attribute information. GPS location can used to update the xy coordinates of the inspected asset and pictures captured can be associated directly with the updated location and sent back to the server. 

Field Data Collection - collect new information in the field with a streamlined data collection application. Often the information that you collect and update in the field is a small subset of the information you take to the field. For example, you may need to collect the location of storm drains for a section of a city. However, within the map you may need to include all layers that define the storm network, street centerlines, easements and block boundaries to provide background information for your data collection tasks. Building an application that displays background information but contains tasks specific to editing storm drains will increase field worker productivity and reduce the amount of training required to use the application. Mobile SDK components specific to the selection of features and sketching of new features help to reduce the time it takes you to build field data collection applications.

Overview Of The Mobile SDK

The following steps are required to build, deploy and maintain a mobile solution using ArcGIS Server:

 

Designing, Authoring and Publishing Mobile Maps

The Mobile SDK extends the capabilities of an ArcGIS Server map resource so that you can distribute spatial information to mobile devices. Maps that you author using ArcMap contain the spatial and tabular information, that not only becomes the map resource you publish, but also the map that is displayed in the mobile application you take to the field. Maps on a mobile device honor properties of the map resource, however considerations need to be made when designing the maps you take to the field  form factor and resolution of the device, map symbology, scale dependency, and complexity of the data itself.

You can publish a map resource using either ArcCatalog or the ArcGIS Server Manager web application. Once you have designed your mobile map and are ready to publish it you can connect to the ArcGIS Server home page and publish your map document as a web service. Following the step by step instructions, enable the map resource for mobile data access and when the web service is created, a URL for mobile access will be created for you. Your mobile application will use this web service URL to connect to the map resource and synchronize map data with your mobile device.

 

 

Using the Mobile SDK with Visual Studio .NET

The Mobile SDK can be used to build very focused Mobile GIS applications quickly and efficiently. By developing a focused application you can improve field productivity and effectiveness by reducing the amount of training that is required to use the application and eliminating potential error by guiding field workers through tasks in the application.

The Mobile SDK components are built on top of the Microsoft .NET Framework, extending the .NET Framework class library with additional classes that support a set of custom controls for both the Windows and Windows Mobile development platforms. You will need Visual Studio .NET 2005 in order to build applications using the mobile components. The Mobile SDK supports building applications for Windows Mobile 5 devices (Pocket PC and Smartphone), Windows Mobile for Pocket PC 2003/2003 SE, Windows CE 5.0 and Windows XP as well.

The suite of mobile .NET components have been integrated into Microsoft Visual Studio .NET so that you can use them to develop custom server-centric lightweight mobile applications quickly and efficiently. These .NET components are designed to improve developer productivity by providing a content rich design time experience that reduces the amount of code that needs to be written. The mobile components scale based upon the target platform chosen (Windows Smartphone, Pocket PC, or Tablet PC) and enable mobile applications to synchronize maps and related information directly with a GIS server and cache information locally on the device to support both connected and disconnected applications. They integrate Global Positioning Systems (GPS) for navigation and spatial data collection. In addition, the schema for layers within a map can be bound directly to ADO.NET data controls so that geodatabase domains and subtypes can be presented in the most effective and efficient manner. In addition to the .NET components, several sample applications and code samples are available to get you started building mobile applications with ArcGIS Server.

 

 

The Mobile libraries can be used to add the following functionality to your mobile application:

 

 

Conceptual view of the Mobile component architecture

 

Map Cache

Maps that you display and edit on a mobile device are stored in a map cache. A map cache is a folder of files that store a representation of the mobile map that you have published using ArcGIS Server. To support both connected and disconnected workflows, all mobile components (including the map component) draw, query and update the map cache. Using the map cache, you can connect to the mobile map that you have published and synchronize changes. From the map cache component, you can open an existing map cache or create a new one given a valid web service. The way that you synchronize changes between the map cache and the geodatabase is by using a connection to the GIS server and methods on the map cache component itself. What information is transmitted between the server and client depends upon the content of the map resource (map and layer properties, layer data source connection, etc) and how you request or post it. Note that you do not need to be connected to the web service to display or edit a map. The map component draws information from the cache itself. You also have a lot of flexibility in how you synchronize information with the server - it has been optimized for low bandwidth transmission.

Map and Map Layers

Mobile maps that you author using ArcMap and publish using ArcGIS Server are displayed using a Map control that you can drag from the toolbox in Visual Studio onto a form. The Map component reads the schema of the map from the map cache property and displays its contents on the control. Listening to the ExtentChanged property you can asynchronously get data from the map cache and display it on the map. You can also change the way that the map displays information stored in the map cache by altering layer properties, creating custom layers, and changing the order and visibility of layers. It is recommended that if you systematically do not want to show certain attributes for a layer or if you want to only draw layers at a given scale that you set visibility and scale dependencies in the map document prior to publishing it. The mobile map component will honor those properties.

Data Access

You can access layer information either from the Map or from the Map Cache. A map layer is used to access and change the way the information in that layer is drawn to the map control. You can also access layer data source information from the map cache - they are known as cache layers. Cache layers can be one of three types (Feature Layer, Raster Layer or Annotation Layer). Feature layers contain features that are stored in the map cache. You can perform SQL queries against the feature layer and get ADO.NET data tables back in return. This integration with ADO provides added flexibility for the developer and improved usability for the field worker as you can directly bind data tables to controls in your application.

Sketch and Geometry

Using the Sketch and Geometry components you can quickly build tools that create new features and update the shape of existing features on the map. The sketch map action is a component that you can drag from the toolbox onto your application, set a number of environment properties directly, and quickly create geometry on the map display writing minimal amounts of code. The sketch map action can have several modes - sketch, modify, add vertex, remove vertex. Sketch modes reduce the amount of code that you have to write in order to perform spatial editing. Geometry can be used not only for editing but to define spatial relationships and to perform spatial queries against features. Geometry can also be used to create map graphics on top of the map.

GPS

Most mobile applications integrate GPS location either as a navigational aid or as input to the creation or update of features. There are 3 main GPS components - SerialPortGpsConnection, FileGpsConnection, and the GPSDisplay. SerialPortGPS is designed to pair input directly with a GPS receiver that is streaming NMEA sentences from a serial port on the device. FileGPS is used to display GPS information from a log file. The GPSDisplay component is designed to synchronize the information decoded by the GpsConnection and display it within a map. To use this component you must specify the active GpsConnection (either SerialPortGpsConnection or FileGpsConnection) and the map on which it will be rendered.

Deploying Your Mobile Solution

Once you have authored and published a mobile map, and then built an application that leverages that map service, you need to define a deployment package for the field device(s) that will be using the application that you have developed and the data that you have published. As a best practice, it is recommended that you generate a map cache that will be deployed along with the application itself. By opening a map cache on the device rather than opening a connection to the server and getting data directly you will reduce the amount of information that needs to be synchronized with the server. You should build a map cache slightly larger than the extent your field worker will be working at and do so at all scales so as to not miss layers because of scale suppression. This is especially important for the productivity of the field worker. If he/she is working in an area with little bandwidth, an unreliable connection, or no connection at all, you still want them to be able to work. You should also consider building a map cache for the entire extent of your background layers. Background layers are static and do not need to be synchronized with the server so why make the field worker pay the price of having to synchronize them in the field?

There are different approaches and technologies that you can use to build a deployment package. It is important to note that whatever approach is taken, it will be a matter of pushing the deployment to the device rather than pulling the deployment from the server. You can package your deployment into a CAB file if you are using Windows Mobile or simply use a zip file on the windows platform. You can push the deployment from a web server using a Microsoft "click once deployment" or by purchasing a technology that will do that task for you. It is recommended that you deploy or provision devices only when you have the best connection possible (cradled device).

 

Day to Day Synchronization

Once you have deployed your application, your field workers can synchronize not only the updates that they make in the field but also all other updates relevant to their work area that have been synchronized with the server.

Getting started

When you are ready to start developing mobile applications, start with the Building Your First Mobile Application tutorial. Also, compile and run the sample applications to get a better understanding of how mobile components can be assembled to build focused mobile applications.