Tag Archives: Windows Embedded Handheld

ArcGIS Mobile SDK and Visual Studio Support Explained!

We have received several questions regarding support for versions of Visual Studio when developing applications and extensions using the ArcGIS Mobile SDK and we would like to address the 2 most common questions in this article.

Can I use Visual Studio 2010 to develop Windows Mobile/Windows Embedded Handheld Applications?

Unfortunately No. Microsoft only supports Windows Phone OS 7.0 and higher with Visual Studio 2010. See the following article from MSDN (http://msdn.microsoft.com/en-us/library/sa69he4t.aspx).

What version of the Compact Framework should I use (2.0 or 3.5)?

ArcGIS Mobile is compiled using .Net CF 2.0. Most Windows Mobile devices in the market today are running Windows Mobile 6.1 or 6.5. These devices include .Net CF 2.0. If you build applications that depend upon CF 3.5 then you will need to deploy 3.5 as a part of your install. So unless there is a feature of 3.5 that you must use, we recommend using version 2.0.

Can I use Visual Studio 2008 with Compact Framework 3.5? 

Officially, the answer is YES. However there is some manual work required for you to get the ArcGIS Mobile libraries integrated into Visual Studio…

The problem you will face is that the ArcGIS Mobile components will not appear inside of the Toolbox. The reason for this is that Microsoft does not load .Net CF 2.0 libraries into a CF 3.5 toolbox (even though 2.0 libraries are fully compatible with a 3.5 framework).

You can work around this issue in the following way:

1) Create a CF 2.0 project and design the form using the 2.0 toolbox elements.

 

2) Upgrade your project to a CF 3.5 project. Note that you will still get the same elements in your form but you will no longer have ArcGIS Mobile toolbox items.

 

Alternately, you can directly create your forms in 3.5 by writing the code behind and not using the Toolbox. This is what we do with the ArcGIS Mobile application in fact.

1) Open the Form.Designer.cs file

partial class Form1

  {

    /// <summary>

    /// Required designer variable.

    /// </summary>

    private
System.ComponentModel.IContainer components
= null;

    private
System.Windows.Forms.MainMenu mainMenu1;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param
name=”disposing”>
true if managed
resources should be disposed; otherwise, false.
</param>

    protected
override void
Dispose(bool disposing)

    {

      if (disposing && (components != null))

      {

       
components.Dispose();

      }

      base.Dispose(disposing);

    }

 

    #region Windows Form Designer
generated code

 

    /// <summary>

    /// Required method for Designer support – do not modify

    /// the contents of this method with the code editor.

    /// </summary>

    private
void InitializeComponent()

    {

      this.mainMenu1 = new
System.Windows.Forms.MainMenu();

      this.Menu = this.mainMenu1;

      this.components = new
System.ComponentModel.Container();

      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;

      this.Text = “Form1″;

      this.AutoScroll = true;

    }

 

    #endregion

 
}

2) Add references to your CF 3.5 project by browsing for our CF 2.0 library 

 

3) Add the necessary new members.

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:”";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:”Times New Roman”;
mso-bidi-theme-font:minor-bidi;}

partial class Form1

  {

    /// <summary>

    /// Required designer variable.

    /// </summary>

    private
System.ComponentModel.IContainer components
= null;

    private
System.Windows.Forms.MainMenu mainMenu1;

 

    /// <summary>

   
/// Esri components

   
/// </summary>

   
private ESRI.ArcGIS.Mobile.WinForms.Map map1;

    private ESRI.ArcGIS.Mobile.FeatureCaching.MobileCache
mobileCache1;

4) Create and Initialize members in InitializeComponent.

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:”";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:”Times New Roman”,”serif”;}

private void
InitializeComponent()

    {

      this.mainMenu1 = new
System.Windows.Forms.MainMenu();

      this.Menu = this.mainMenu1;

      this.components = new
System.ComponentModel.Container();

      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;

      this.Text = “Form1″;

      this.AutoScroll = true;

 

      this.SuspendLayout();

 

     
// Map

     
this.map1 = new
ESRI.ArcGIS.Mobile.WinForms.Map();

     
this.map1.Location = new
System.Drawing.Point(23, 29);

     
this.map1.Name = “map1″;

     
this.map1.Size = new
System.Drawing.Size(200, 200);

     
this.map1.TabIndex = 0;

     
this.map1.Text = “map1″;

     
this.Controls.Add(this.map1);

 

     
// Cache

     
this.mobileCache1 = new
ESRI.ArcGIS.Mobile.FeatureCaching.MobileCache(this.components);

 

     
this.ResumeLayout(false);

    }

 

5) You should get the following result.

 

Given that the time you will spend designing the form is negligible, we recommend the later approach for your 3.5 development.  

 

 

Posted in Mobile | Tagged , , , , , , , , | Leave a comment