banner



How To Create Windows Mobile Application In Visual Studio 2010

Introduction

Microsoft Visual Studio 2008 Professional Edition or amend provides a development environment that allows you to build applications in either native lawmaking (C / C++) or managed code (C# / Visual Bones .NET) for Windows Mobile devices.

This article provides information to correctly install Visual Studio 2008 and boosted Windows Mobile Software Development Kits in club for you to create your first Windows Mobile application, targeting a Windows Mobile 6 device. This article also introduces the Device Emulator which allows y'all to examination your Windows Mobile applications without the need to have a physical Windows Mobile device bachelor.

Installation of Visual Studio 2008 and boosted SDKs

Let us assume yous accept a brand new evolution machine that you lot want to utilise to develop applications for Windows Mobile devices. The first thing you want to do is install Visual Studio 2008 and, depending on the speed of your Cyberspace connectedness, you might also want to install all MSDN help files locally on your development system. If yous don't own Visual Studio 2008, you lot can download an evaluation version of Visual Studio 2008 Professional. Installing both Visual Studio 2008 and MSDN Library for Visual Studio 2008 is pretty straightforward. After a number of installation prerequisite files accept been installed on your development machine, immediately after you install the DVD containing Visual Studio 2008 Professional Edition in the DVD drive, y'all volition run across a setup magician. By merely selecting the default options, you volition install Visual Studio 2008 with Smart Device Development enabled.

After the installation of Visual Studio 2008 and the MSDN Library for Visual Studio 2008, at that place is i more than affair yous might want to do. If you take a look at the installation dialog for both Visual Studio 2008 and the MSDN Library, you tin can see a hyperlink to bank check for updates. It is my recommendation to do so, since this guarantees you to install the latest security updates, depending on the Operating Organisation you are running on.

Next, you demand to download and install Visual Studio 2008 Service Pack 1. First, a relatively small installer will be downloaded, which downloads all necessary Service Pack 1 features, depending on the way you installed Visual Studio 2008. Depending on your download speed, this might be a lengthy performance.

Visual Studio 2008 should at present piece of work properly on your development car. To verify correct installation of Visual Studio 2008, information technology is now fourth dimension to beginning information technology from the Windows Start bill of fare. Afterward Visual Studio 2008 has started, you can create a new Windows Mobile application by clicking File - New Project. In the New Project dialog that is displayed, you can now select to create a Smart Device project, either in C# or in Visual Basic .NET. Let's assume you want to create a Windows Mobile half-dozen application written in C#. To do this, expand the C# node in the Project Types window and select Smart Device. Visual Studio 2008 will give your project a default name and a default storage location. Optionally, you tin requite your project a name, and you can specify a location where your project will be stored. This is all the data yous need to provide in this dialog. To continue creating your awarding, you must now click the OK button in the New Project dialog. This activity will open up the Add New Smart Device Projection dialog in which you tin specify what type of project yous want to create and what additional settings y'all desire for your project.

Before you continue creating your first Windows Mobile application, expand the Target Platform combo box. If you just installed a clean copy of Visual Studio 2008, you volition run into that you lot can create projects for a limited number of devices and that at that place is no back up to create Windows Mobile 6 projects. In order to create Windows Mobile half-dozen projects, you must first install 1 or both of the Windows Mobile 6 SDKs. An SDK or Software Development Kit adds documentation, sample code, header and library files, emulator images, and tools to Visual Studio that permit you build applications for a particular target. You need to install these SDKs separately because they were released independent and at a later time than Visual Studio 2008. More SDKs and additional emulator images might be bachelor at a after time. To easily find new SDKs, in that location is a hyperlink to the Windows Mobile Programmer Center on the Add New Smart Device Project dialog, from which you tin download and install additional SDKs and emulator images. To make sure that the SDKs install properly, you must make certain to close Visual Studio 2008.

Note: If you have the Windows Mobile half-dozen SDKs already installed, for instance, to target Windows Mobile vi devices from inside Visual Studio 2005, you demand to either reinstall or repair the SDKs after installing Visual Studio 2008. If you don't practice this, you lot cannot target Windows Mobile 6 devices from inside Visual Studio 2008.

MOB4DEVS01/mob01fig1.jpg

Figure 1 - New Smart Device Project dialog

If yous have installed one or both of the Windows Mobile 6 SDKs, you lot are ready to create your first application for a Windows Mobile 6 device. In social club to echo the steps shown in this document, you at least will demand to install the Windows Mobile 6 Professional SDK.

Creating your kickoff Windows Mobile awarding

With all the tools being installed, yous are now fix to create your kickoff Windows Mobile half dozen application. For this application, you will target the Windows Mobile vi Professional SDK. However, you lot can build applications and solutions for a large number of Windows Mobile devices and for generic Windows CE devices. With both Windows Mobile 6 SDKs installed, you can develop solutions for the following devices using Visual Studio 2008:

  • Pocket PC 2003
  • Windows CE (non Windows Mobile devices)
  • Windows Mobile 5.0 Pocket PC
  • Windows Mobile 5.0 Smartphone
  • Windows Mobile 6 Professional
  • Windows Mobile half dozen Standard

With Visual Studio, you lot tin target ii different versions of the .NET Compact Framework, a subset of the full .NET Framework that is used to write managed applications for Smart Devices. The following versions of the .Cyberspace Meaty Framework can exist targeted with Visual Studio 2008:

  • .NET Compact Framework Version two.0
  • .NET Meaty Framework Version three.5

If you need to develop applications for older devices, or if you lot need to target a previous version of the .NET Compact Framework, you must utilise Visual Studio 2005. This is beyond the scope of this article, but y'all can install Visual Studio 2005 and Visual Studio 2008 adjacent.

To create a new Smart Device Project

  1. Open Microsoft Visual Studio 2008.
  2. On the File card, click New, and and so select Project.
  3. In Project types, select Visual C#, and and then select Smart Device.
  4. Specify a new name, location, or solution proper name for your Smart Device Projection, then click OK. An additional dialog similar to Figure 1 will open in which you tin can specify the type of project you want to create, the SDK you want to target, and the version of the .Net Meaty Framework you lot want to use.
  5. In the Target Platform list, select Windows Mobile six Professional SDK.
  6. In the .Internet Meaty Framework version list, select .NET Compact Framework Version 3.v.
  7. In the available Templates, select Device Application.
  8. Click OK to create a new Smart Device solution projection, which includes the following:
    • References to the necessary assemblies
    • AssemblyInfo.cs, a file that enables yous to specify company, product data, and version data for the Smart Device application
    • Form1.cs, a Visual C# code file that you tin can use to create the initial user interface for your Smart Device awarding (you tin can either view the source code in an edit window or the form in designer mode)
    • Program.cs, a Visual C# lawmaking file containing the entry indicate of your application

If you have created your first Smart Device project successfully, you lot volition see the Grade Designer in Visual Studio 2008, displaying your empty class.

MOB4DEVS01/mob01fig2.jpg

Figure 2 - Visual Studio 2008 Course Designer

You can see several of import areas inside Visual Studio 2008 in Figure 2. The large area on the left hand side of Visual Studio 2008 that shows a peel of a Windows Mobile device is the Form Designer. Y'all can add together user interface controls by dragging them from the Toolbox and dropping them on the desired location within Form1. The upper window on the right mitt side of Visual Studio 2008 is the Solution Explorer. It contains a tree view of all your projects and files within projects that are office of the solution you are working on. Under Solution Explorer, you lot tin can run into the Properties window, which allows you to ready properties for currently selected user interface controls.

Notation: If the Properties window is non visible in your copy of Visual Studio 2008, yous can make it visible by selecting View and and then Properties Window on the Visual Studio 2008 menu.

Another of import office inside your working area of Visual Studio 2008 is the Target Device dropdown box, which is marked past a cherry-red oval in Figure 2. Hither, y'all can select to which device or which particular device emulator your application volition be deployed once yous are done developing it.

To add functionality to your awarding

  1. Drag a Push from the Toolbox and drib information technology anywhere on Form1.
  2. In the Properties window, change the (Name) property from button1 to btnClickMe.
  3. Also in the Properties window, change the Text property from button1 to Click ME!.
  4. Drag a Label from the Toolbox and driblet information technology anywhere on Form1.
  5. Resize the merely added Label inside Form1 so it occupies the entire width of Form1.
  6. In the Properties window, change the (Proper noun) belongings from label1 to lblInfo.
  7. Also in the Properties window, empty the contents of the Text property.
  8. Make the properties of Form1 visible in the Properties window by clicking anywhere on Form1.
  9. Fix the MinimizeBox property to Fake to allow you to end the awarding past clicking the OK push that will now be displayed in the upper correct corner of Form1.
  10. Double click on the Click ME! Push button to add a Click event handler to the button.
  11. On the location where the cursor is now located inside the source code editor, add the following code:
lblInfo.Text =          "          Button '"          +                 btnClickMe.Text +          "          ' clicked at "          +                 DateTime.At present.ToLongTimeString();        

Note: You will see syntax coloring inside the lawmaking editor, and Intellisense will assist you in entering this statement.

To build and deploy your application

  1. From the Build menu, select Build Solution. Assuming you lot didn't make any errors, yous will run into the following message in the status bar of Visual Studio 2008: Build succeeded.
  2. Make sure that the Windows Mobile 6 Classic Emulator is selected in the Target Device dropdown box.
  3. From the Debug carte du jour, select Commencement Debugging.

After some time, you will see the Windows Mobile 6 Classic Emulator starting. If necessary, .NET Compact Framework 3.5 volition be deployed first to the emulator. Finally, your application will exist deployed to the device, where it is automatically started.

MOB4DEVS01/mob01fig3.jpg

Figure 3 - Your kickoff awarding running in the Device Emulator

To test your application

  1. Inside your application that is running in the Device Emulator, click the Click ME! push, and you should see some text appearing in the characterization you have created on your course.
  2. Repeat clicking the button several times, and you should see the time inside your label being updated.
  3. Click on OK in the upper correct mitt side of your application to terminate it.
  4. Close downwardly the emulator by selecting File on its menu, followed by Save State and Leave.
  5. Shut downwardly Visual Studio 2008.

Related articles in this serial

  • Windows Mobile App Development Office ii: Device Emulator and Device Emulator Manager

    Use Device Emulator and Cellular Emulator to exam your applications.

  • Windows Mobile App Development Office 3: Basic WinForms App Evolution for Windows Mobile Devices

    Acquire the nuts of developing Windows Forms based applications for Windows Mobile devices.

  • Windows Mobile App Evolution Part 4: Adding Custom Controls and Making Employ of GPS Hardware

    Acquire to add together custom controls and brand use of GPS hardware in your applications.

  • Windows Mobile App Evolution Role 5: Intro to using SQL Server CE

    Learn to access data through DataSetdue south and SQLCeResultSets in your Mobile apps.

  • Windows Mobile App Development Role six: Device Security and Awarding Deployment

    Gain an understanding of device security, testing, and installation of your awarding on a Windows Mobile device.

  • Windows Mobile App Development Part seven: Mobile Web Development

    Larn to create web based apps for Mobile devices with AJAX support enabled using browser controls.

Boosted resources and references

  • Windows Mobile Programmer Center
  • Introduction to development with Microsoft Windows Mobile 6
  • Development Tools and Resources for Windows Mobile half dozen
  • Code Samples for Windows Mobile
  • How do I Build a .Internet Compact Framework three.5 Awarding for Windows Mobile 6 Devices
  • Introduction to Windows Mobile Device Development
  • What's new for Developers in Windows Mobile 6

Delight visit world wide web.myrampup.com for more information.

Source: https://www.codeproject.com/Articles/43357/Windows-Mobile-App-Development-Part-1-Creating-you

Posted by: mitchellroyes1995.blogspot.com

0 Response to "How To Create Windows Mobile Application In Visual Studio 2010"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel