Advanced Symbology Draw and Update Symbol
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
- Download the resource file from Esri download site
- Create a folder on your desktop named SymbolDictionary
- Extract 2525cSymDictionary_v1.0.zip to your the SymbolDictionary folder you just created.
- Create an ArcGIS folder on your device. This requires you to use the Android Debug Bridge (adb) tool found in <sdk-dir>/platform-tools.
- Open up a command prompt and execute the adb shell command to start a remote shell on your target device.
- Navigate to your sdcard directory, cd /sdcard/
- Create the ArcGIS directory, mkdir ArcGIS.
- 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.
- Exit the shell with the, exit command.
- 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.
- Install the APK to your device
- The map will display the World Topo Basemap with two sets of Mil2525C symbols obtained from the Symbol Dictionary
- Long press any of the bottom blue symbols to move them on the map.