Creating Pocket PC Apps with the Smart Device Extensions

Author: James Foster

Microsoft has recently announced the beta of the .NET Compact Framework, which is designed for the Pocket PC platform, as well as the Smart Device Extensions, an add-on to Visual Studio.NET to simplify the development of Pocket PC applications. You do not need to own a Pocket PC PDA to develop applications as the Smart Device Extensions contains an emulator for you to test out your applications. This article walks you through the development of a simple Pocket PC application, getting you started on the road to being a Pocket PC developer.

The Smart Device Extensions can be obtained here:

(C:If your .NET Framework Version is 1.1 or above ,you can pass this step.)
 
Creating a Project

The Smart Device Extensions integrate directly into the Visual Studio IDE. Once installed, they add a new project type for C# and VB.NET applications: the Smart Device Application. This is shown in the following screenshot:

This starts the Smart Device Application Wizard. You have the choose of targeting Windows CE .NET devices, or Pocket PCs. You also have the option of creating a WinForms application, a Class Library (assembly), or a Control Library. We'll opt to target the Pocket PC, and create a Windows Application.

We then click finish, and Visual Studio will have a Windows Form ready for us. This is very similar to a regular Windows Form, with the differences being a smaller Controls library to choose from, the "Device Controls", as well as the smaller form size. Pocket PCs typically use a 240x320 resolution.

 

As is typical in software development, the first application you write usually prints out "Hello World". Our application will feature a textbox and a button. The user can enter in their name, and clicking the button will show a messagebox greeting them by name.

 

First, drag a label, textbox, and button onto the form from the Device Controls toolbar. Rename the textbox to txtName, and the button to btnSubmit. Double-click the submit button. This will generate a skeleton wrapper for the click event. Enter in the following line of code:

 

MessageBox .Show ( "Hi " + txtName .Text );
 
C#VB

The following screenshot shows our form loaded in the Visual Studio.NET environment.

Testing in the Emulator

Now that we have our simple application, let's move onto testing it. From the Build menu, select Build Solution (or press ctrl+alt+B). You should have no compile errors. Next, on the Debug menu, select Start (or press the "Play" toolbar icon). This will bring up the Deployment dialog. You can deploy and test your application on a real Pocket PC attached to your computer, or you can use the emulator. We'll select the Pocket PC Emulator and click Deploy. If this is your first application, the emulator will load the .NET runtime into it's image. The Emulator will load the Today screen, and then Visual Studio will continue to load your application. You can follow the progress of the load in Visual Studio's status bar. Eventually, the application will load in the emulator. Enter your name in the textbox, and click the button. You should get a messagebox greeting your by name, as shown in the screenshot below.

As you can see, with the Smart Device Extensions, writing Pocket PC Applications is a snap. Now you are ready to explore more of the .NET compact framework, and write your own applications.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值