What's new in the ArcGIS Mobile 9.3 SDK
ArcGIS Mobile has grown at 9.3 to include a new out of the box application and an expanded Mobile SDK. The ArcGIS Mobile Application is build with the Mobile SDK components, and thus shares the Mobile system functionality. For generic changes made to the ArcGIS mobile system see the What's new with ArcGIS Mobile document. While the core features of the Mobile SDK remain in the new release, there are many enhancements and additions. The Mobile assembly has been restructured with five new namespaces to support this growth and provide room for future growth.
System packaging and deployment
Part of the changes in 9.3 include the way in which the Mobile SDK is built and deployed. This will impact developers using the SDK to build an application or deployment package and the client installing the software. In 9.2, the Mobile SDK dlls were not placed in the DotNET GAC on the client system, which meant each application required a copy of the dll in the application folder. At 9.3, there is a ESRI.ArcGIS.Mobile.GAC file which must be deployed to the client device and allows multiple applications to use a single Mobile dll file, which only needs to be deployed once. This installation process is best done by using the AGSRuntime.cab file which is copied to your device or emulator and then run or unpacked. This process will install the runtime (a few dlls) and register them in the registry table. For additional information refer to the Deploying ArcGIS Mobile Applications topic.
Assembly restructuring
To support the new features in this release and beyond, and organize the SDK into its logical, inherent structure the ArcGIS Mobile assembly has added 5 namespaces. The namespaces are used to group the functionality into logical partitions so developers can better design and implement their applications.
The new namespaces are:
- CatalogServices
- Geometries
- MapActions
- MobileServices
- SdcData
These changes will have no impact on the end user, as the namespaces are used to group the classes for developers, the code deployed in the dlls remains the same. More information on the functionality contained in each namespace can be found in the namespace overviews. Also, there are a few classes that have changed their properties, for example the snapping environment has moved to the Map class.
Geometries namespace
The new Geometries namespace contains the classes used to represent features stored in the data layers. Most of the classes in this namespace existed in the previous release, although they have been updated. The changes made to the geometry classes that represent feature such as point and polygon allow for more generic construction methods to make working with the various geometry types easier. The geometry feature classes have been given the ability to raise an event to signal changes, though the GeometryChanged event. The new classes in this namespace are CoordinatesChangedEventArgs, GeometryChangedEventArgs, and SpatialIndex. Another enhancement made was the addition of the PropertyChanged event to the Coordinate class, which provides the mechanism to signal that one of it's properties has changed to anyone listening. The CoordinateCollection has been updated to be a BindingList to leverage the native functionality of the BindingList class, such as OnListChanged. For more details on what these changes mean to the developer refer to Developing with Geometry or the Geometries namespace reference material.
GPS namespace
The big change for the GPS namespace has been the elimination of the GpsEventArgs class, with most of its members being moved to the GpsConnection class. The GpsEventArgs class was used to broadcast the GPS information being received and updated though the GpsConnection classes, on the GpsChanged Event. At 9.3 a new class, NMEASentenceEventArgs, is used to broadcast the sentence coming from the GpsConnection, on the GpsChanged event. This new class only contains the NMEASentence, and is thus smaller and faster to populate and throw. The many other members that were broadcast using the old EventArgs class, are now accessible as properties on the GpsConnection class.
The GpsDisplay class has been simplified to focus on the basics of showing the GPS location on the map display. The Pan property has been renamed to AutoPan to better reflect the fact that it is used to specify that the map should continuously move with the GPS updates.
Sketch namespace
The Sketch namespace contains the classes used for editing data geometries. While many of the classes will look familiar to a 9.2 developer, such as AddVertexSketchtool replacing a AddVertex class, the process of editing features has changed. See the text below for a list of functionality changes and the Mobile Editing Framework document for in depth information. The library overview has more technical information on how to use the classes in the Sketch namespace
To be editable the featureclasses must have a GlobalID field in 9.3.
There are significant changes and improvements to how you develop editing tools using the ArcGIS Mobile SDK for the 9.3 release. The following is a list of key functionality updates and changes that are included in the SDK:
- New Sketch abstract class - a new abstract class called Sketch replaces the SketchMapAction. All sketch tools inherit from the sketch class and you can use the sketch class to create your own sketch tools.
- Sketch Tool mode removed - in 9.2 there was one sketch tool that performed various functions using a sketch mode. With 9.3, there are sketch tools representing each mode.
- New Sketch Tool Map Actions - there are two new sketch tools called InsertVertexSketchTool and MoveVertexSketchTool. Using these new tools, you can alter the shape of existing features.
- Drawing sketch geometry - sketch display feedback is now contained within a graphic layer called SketchMapGraphicLayer. This improves the performance of sketching and provides more options for symbolizing sketch geometry.
- FinishPart and FinishSketch removed - both are no longer part of the editing API. This provides more freedom for the developer in deciding when a particular sketch is completed.
- Geometry improvements - geometry now exposes the Geometry.CurrentPartIndex or Geometry.CurrentPart and Geometry.CurrentCoordinateIndex. These are used by the sketch tools in order to set or get the current part and the current editing vertex in the part's coordinate collection. In addition, geometry now is the class used to add/delete/modify vertices instead of the sketch tools itself. The Geometry.GeometryChanged event is responsible for notification when it has been changed.
For more detailed information regarding the functionality in the editing namespace and how to use it, please read Working with Editing Tools.
Spatial references
With the new projection engine in ArcGIS Mobile 9.3, there are a variety improvements, even though the SDK API did not change very much. This library is build from a subset of the core projection engine (pe.dll) used in ArcGIS. The library is located in the same directory of SDK installation, \ArcGIS\DotNet\Mobile\9.3 and \ArcGIS\DotNet\Mobile\9.3\WindowsCE. The filename is ESRIMobilePE93.dll for both, although one is for Windows and one is for Windows CE.
The new library is a native dll, it is accessed internally through SpatialReference class. Mobile SDK developers will not interact with the new pe library directly, it is used through the classes in the spatial reference namespace. The library supports transformations to any coordinate system. However the GPS input supported are not available for all spatialreferences, which should be considered when designing your map. The WGSGeoTransformations are now encapsulated in a separate class.
A major improvement for spatial reference, streamlining projections is due to a change in the Geometries namespace. At 9.3 the Mobile SDK no longer exposes integers, which means the geometry properties are expressed as doubles, in the mobile client just as they are in the host server. This impacts the spatial reference classes since the methods used in 9.2 to convert between the mobile client integer based geometry to server based double geometries are no longer needed.
Other changes
In the Mobile namespace an abstract datasource class has been added to allow new types of data to be bought into the mobile map display. Both the DataSource and MapLayer class now have a SpatialReference class which is used to ensure that the layers being added to the Mobile Map have the same spatial reference. The Map uses the spatial reference of the first layer added and subsequent layers must have this spatial reference.
Migrating from 9.2 to 9.3
With all the changes between 9.2 and 9.3 for the Mobile SDK, the migration will require more than changing the library reference and some class names. However this migration can usually be done fairly quickly, if you make your code changes without trying to redesign your application at the same time. To help ease this migration, follow a few standard practices such as making a backup copy of your solution, having a 9.3 server and cache data ready, and making your changes in the order listed.
- Make a copy of your solution folder with windows explorer not from Visual Studio.
- Open your solution in Visual Studio.
- Remove the reference to the 9.2 ArcGIS Mobile assembly.
- Add a reference to the 9.3 ArcGIS Mobile assembly.
- Clean your solution and then save your changes.
- Remove the MapControl from your form and delete the MapAction components.
- Add the MapControl form the Visual Studio Toolbox, the MobileService will be added automatically.
- Use the MapActions Dialog to add the MapActions you used in your solution.
- In your form code file update your Using and Import statements to the 9.3 namespaces.
- Use the Find and Replace Tool to change mapCache to mobileService in your code.
- Clean your solution and then save your changes.
- Use your Error List window to locate and fix the remaining errors.