Getting started

Requirements

To develop applications using the ArcGIS API for Windows Phone, you need to meet the system requirements. The Windows Phone Developer Tools are the main software requirement. Download and install both the Windows Phone Developer Tools and the Windows Phone Developer Tools January 2011 Update. See Installing Windows Phone Developer Tools for additional information.

The Windows Phone Developer Tools 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 API for Windows Phone development is also supported with Visual Studio 2010 and with 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/windows-phone-7.

Downloading the ArcGIS API for Windows Phone SDK

The ArcGIS API for Windows Phone setup program includes the files needed to develop ArcGIS applications for the Windows Phone platform.

  1. Download the ArcGIS API for Windows Phone from the resource center.
  2. Run the setup to install the ArcGIS API 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.
  3. Your install location will contain the assemblies required to develop with the ArcGIS API 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 API for Windows Phone assembly

    Description

    ESRI.ArcGIS.Client.dll

    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.

    ESRI.ArcGIS.Client.Bing.dll

    Adds support for Bing layers and services.

    ESRI.ArcGIS.Client.Toolkit.dll

    Contains a set of common controls for use with the map, such as a Legend and InfoWindow.

    ESRI.ArcGIS.Client.Toolkit.DataSources.dll

    Contains a set of layer types that support common data sources, such as OpenStreetMap and WMS.

    Source available on CodePlex: http://esrisilverlight.codeplex.com.

    ESRI.ArcGIS.Client.WebMap.dll

    Contains components that read and process WebMap contents and metadata. It uses the arcgis.com web map specification version 1.1.

Creating an application using the ArcGIS API for Windows Phone

Once you have the ArcGIS API for Windows Phone SDK setup on your development machine, you're ready to write your first application.

  1. Open Visual Studio 2010 Express for Windows Phone.
  2. Click File, then click New Project to create a project. The New Project dialog box opens.
  3. From the Installed Templates list, select C#, then select Silverlight for Windows Phone.
  4. Select the Windows Phone Application template and provide a name for your application. See the following screen shot:

    Screen shot of the New Project dialog box with the Windows Phone Application template selected.

  5. Click OK.The target version dialog box, titled New Windows Phone Application, opens. See the following screen shot:
    Screen shot of the target version dialog box.
  6. Set the Target Windows Phone OS Version to Windows Phone OS 7.1 and click OK to create your project.
  7. In the Solution Explorer, right-click the references for your project and click Add Reference. The Add Reference dialog box opens.
  8. Select the .NET tab and select the ESRI.ArcGIS.Client.dll that's included with the ArcGIS API for Windows Phone.
  9. Click OK.
  10. Open MainPage.xaml if it's not already open and switch to the XAML view if it's not already visible.
  11. 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:

    xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
    

  12. 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>
    
    NoteNote:

    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.

  13. Save and run the application. The Windows Phone emulator will display the application as shown in the following image:

    Windows Phone emulator showing the application.

4/18/2012