To develop applications using the ArcGIS Runtime SDK for Windows Phone, you need to meet the system requirements. Visual Studio 2010 and Windows Phone SDK 7.1 are the main software requirements. See Installing the Windows Phone SDK for additional information.
The Windows Phone SDK includes Visual Studio 2010 Express for Windows Phone if you do not already have Visual Studio 2010 on your machine. This is the integrated development environment (IDE) that is used throughout the documentation in this Help system. However, ArcGIS Runtime SDK for Windows Phone development is also supported with Visual Studio 2010 and Microsoft Expression Blend 4.
You are expected to have a familiarity with Windows Phone development. Documentation on Windows Phone development can be found at the Microsoft Windows Phone developer site: http://developer.windowsphone.com.
Downloading the ArcGIS Runtime SDK for Windows Phone SDK
The ArcGIS Runtime SDK for Windows Phone setup program includes the files needed to develop ArcGIS applications for the Windows Phone platform.
- Download the ArcGIS Runtime SDK for Windows Phone.
- Run the setup to install the ArcGIS Runtime SDK for Windows Phone, selecting a destination folder for the installation. This directory is referred to as your install location in the rest of this topic.
- Your install location will contain the assemblies required to develop with the ArcGIS Runtime SDK for Windows Phone. The following table lists the assemblies and provides a description of their contents. These assemblies only provide 32-bit support at this time.
ArcGIS Runtime SDK for Windows Phone assembly
Core library. Contains map, ArcGIS Service layers, graphics, geometry, and symbol components. Also contains common workflow tasks that support query, find, identify, and geospatial and geoprocessing operations.
Includes support for Bing layers and services.
Contains components that support working with the ExportWebMap server task introduced with ArcGIS 10.1 for Server.
Contains a set of common controls for use with the map, such as a Legend and InfoWindow.
Contains a set of layer types that support common data sources, such as OpenStreetMap and WMS.
Source available on CodePlex: http://esrisilverlight.codeplex.com.
Includes support for connecting to, querying, and returning portal content, such as web maps. Portals include ArcGIS Online (ArcGIS.com) and on-premise Portal for ArcGIS installations.
Creating an application using the ArcGIS Runtime SDK for Windows Phone
Once you have the ArcGIS Runtime SDK for Windows Phone SDK setup on your development machine, you're ready to write your first application.
- Open Visual Studio 2010 Express for Windows Phone.
- Click File, then click New Project to create a project. The New Project dialog box opens.
- From the Installed Templates list, select C#, then select Silverlight for Windows Phone.
- Select the Windows Phone Application template and provide a name for your application. See the following screen shot:
- Click OK. The target version dialog box, titled New Windows Phone Application, opens. See the following screen shot:
- Set the Target Windows Phone OS Version to Windows Phone OS 7.1 and click OK to create your project.
- In the Solution Explorer, right-click the references for your project and click Add Reference. The Add Reference dialog box opens.
- Select the .NET tab and select the ESRI.ArcGIS.Client.dll that's included with the ArcGIS Runtime SDK for Windows Phone.
- Click OK.
- Open MainPage.xaml if it's not already open and switch to the XAML view if it's not already visible.
Add a namespace reference to the ESRI.ArcGIS.Client library and namespace by inserting the attribute shown in the following code as an attribute of the phone:PhoneApplicationPage element in the XAML:
- Add a map and a layer to the content panel of the application by updating the ContentPanel to match the following code:
<Grid x:Name="ContentPanel" Grid.Row="1"> <esri:Map x:Name="MyMap" Extent="-120, 20, -100, 40"> <esri:Map.Layers> <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"> </esri:ArcGISTiledMapServiceLayer> </esri:Map.Layers> </esri:Map> </Grid>Note:
The esri:Map.Layers element is optional. The layer elements can be directly included in the esri:Map element.
This fills the content area with a map showing the World Street Map.
- Save and run the application. The Windows Phone emulator will display the application as shown in the following image: