Advanced Symbology Draw and Update Symbol

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data for Desktop Data Path: Download the Resource Bundle from ArcGIS Online

The purpose of this sample is to introduce you to the Advanced Symbology features in the API. For any Advanced Symbology apps you need to Symbol Dictionary and default Message Types on your device in the following default location //mnt/sdcard/ArcGIS. This is where the MessageProcess class will look for the Symbol Dictionary resources. To use a custom path you need to use the MessageProcessor overloaded constructor which takes in a java.lang.String Symbol Dictionary path.

Sample Design

This sample illustrates the use of MessageProcessor class to process Advanced Symbology features whose definitions are stored locally on your device. The MessageProcessor class provides the capability to take a message received from an external source and convert it into a symbol which is displayed on a map in a graphics layer. The MessageProcessor classrequires a GroupLayer to be added to an initialized MapView.

The MessageProcessor constructor requires a DictionaryType which indicates the type of symbol dictionary is being used. The Message class encapsulates information from an incoming or outgoing message. Apart from a message ID all other properties in the message are held in name-value pairs.

When you run this sample there will be 2 types of symbols drawn on the World Topo Basemap. You can extend the sample easily to add more symbol types from the dictionary.

Using the Sample

Steps:
  1. Download the resource file from ArcGIS Online
  2. Create a folder on your desktop named SymbolDictionary
  3. Extract 2525cSymDictionary_v1.0.zip to your the SymbolDictionary folder you just created.
  4. Create an ArcGIS folder on your device. This requires you to use the Android Debug Bridge (adb) tool found in <sdk-dir>/platform-tools.
  5. Open up a command prompt and execute the adb shell command to start a remote shell on your target device.
  6. Navigate to your sdcard directory, cd /sdcard/
  7. Create the ArcGIS directory, mkdir ArcGIS.
  8. You should now have the following directory on your target device, /mnt/sdcard/ArcGIS/. We will copy the contents of the downloaded resource into this directory.
  9. Exit the shell with the, exit command.
  10. While still in your command prompt, navigate to the folder where you created the SymbolDictionary folder and execute the following command. adb SymbolDictionary /sdcard/ArcGIS.
  11. Install the APK to your device
  12. The map will display the World Topo Basemap with two sets of Mil2525C symbols obtained from the Symbol Dictionary
  13. Long press any of the bottom blue symbols to move them on the map.
5/31/2012