Application Architecture Guide 2.0 - CH 19 - Mobile Applications(6)

本文翻译第19章的最后部分,包括"Technology Considerations"中的".NET Compact Framework"、"Windows Mobile"、"Windows Embedded"和"Additional Resources"部分。

 

.NET Compact Framework

Consider the following guidelines if you are using the Microsoft .NET Compact Framework:

If you are familiar with the Microsoft .NET Framework and are developing for both the desktop and mobile platforms concurrently, consider that the .NET Compact Framework is a subset of the .NET Framework class library. It also contains some classes exclusively designed for Windows Mobile. The .NET Compact Framework supports only Microsoft Visual Basic® and Microsoft Visual C#® development.

If you are attempting to port code that uses Microsoft Foundation Classes (MFC), consider that it is not trivial due to MFC’s dependency on Object Linking and Embedding (OLE). The Windows Compact Edition supports COM, but not OLE. Check to see if the OLE libraries are available for separate download to your device before trying to use MFC on a mobile device.

If you have issues a subset of Windows Mobile code with the Visual Studio debugger, consider that you might require multiple debug sessions. For example, if you have both native and managed code in the same debug session, Visual Studio might not follow the session across the boundary. In this case, you will require two instances of Visual Studio running and will have to track the context between them manually.

.NET Compact Framework

如果你在使用Microsoft .NET Compact Framework,那么就考虑如下指导方针:

如果你很熟悉Microsoft .NET Framework,并且同时在开发桌面应用和移动应用,那么将Microsoft .NET Compact Framework看成.NET Framework类库的一个子集。他还包括一些特别为Windows Mobile设计的类。.NET Compact Framework只支持Microsoft Visual Basic®Microsoft Visual C#®语言来开发。

•由于MFCOLE的依赖,如果你尝试移植MFC代码, 那么这就不是小事一桩。Windows CE支持COM,但不支持OLE。那么,在移动设备上使用MFC之前,确认OLE库是否可以单独下载到你的设备上。

•如果你想使用Visual Studio调试器来追踪代码,考虑可能需要多个调试会话。例如,如果你在一个调试会话中拥有本地代码和托管代码,Visual Studio可能不跟随会话。在这种情况下,你就需要运行两个Visual Studioinstance来手动追踪他们之间的内容。

 

Windows Mobile

Consider the following general guidelines for Windows Mobile applications:

If you are targeting an application for both Windows Mobile Professional and Windows Mobile Standard editions, consider that the Windows Mobile security model varies on the different versions of Windows Mobile. Windows Mobile Standard (Smartphone) supports three levels: blocked, normal, and privileged mode. Windows Mobile Professional (Pocket PC) supports only blocked and privileged mode. Code that works on one platform might not work on the other because of the differing security models for APIs. Check the Windows Mobile documentation for your device and version.

Windows Mobile应用程序考虑如下通用指导方针:

•如果你要设计同时运行于Windows Mobile ProfessionalWindows Mobile Standard之上的应用程序,那么就要考虑不同Windows Mobile版本上的不同的安全模型。Windows Mobile Standard (Smartphone)支持三个级别:受限,正常和特权模式。Windows Mobile Professional (Pocket PC)只支持受限模式和特权模式。在一个平台上可以工作的代码可能在另一个平台上就不能工作了,因为安全模式的API不同。检查你Windows Mobile设备的文档和版本。

 

If you will have to manage your application in the future or are upgrading an existing application, be sure that you understand the Windows Mobile operating system derivation, product naming, and versioning tree. There are slight differences between each version that could potentially impact your application.

Windows Mobile is derived from releases of the Windows CE operating system.

Both Windows Mobile version 5.x and 6.x are based on Windows CE version 5.x.

Windows Mobile Pocket PC was renamed Windows Mobile Professional starting with Windows Mobile 6.0

Windows Mobile Smartphone was renamed Windows Mobile Standard starting with Windows Mobile 6.0.

Windows Mobile Professional and Windows Mobile Standard have slight differences in their APIs. For example, the Windows Mobile Standard (Smartphone) lacks a Button class in its Compact Framework implementation because softkeys are used for data entry instead.

•如果你要在以后管理你的应用程序,或者升级现在的应用程序,那么确认你认识了Windows Mobile操作系统的来历,产品名字,和版本树。各个版本之间可能会有轻微的差别,影响你的应用程序。

         Windows MobileWindows CE操作系统的发布衍生而来。

         Windows Mobile 5.x6.x都是基于Windows CE 5.x的版本上的。

         Windows Mobile 6.0以后,Windows Mobile Pocket PC被命名为Windows Mobile Professional

         Windows Mobile 6.0以后,Windows Mobile Smartphone被命名为Windows Mobile Standard

         Windows Mobile ProfessionalWindows Mobile StandardAPI上有所不同。例如,Windows Mobile Standard (Smartphone)Compact Framework类库中缺少Button类,因为他使用软键盘处理数据输入。

 

Always use the Windows Mobile APIs to access memory and file structures. Do not access them directly after you have obtained a handle to either structure. Windows CE version 6.x (and thus the next release of Windows Mobile) uses a virtualized memory model and a different process execution model than previous versions. This means that structures such as file handles and pointers may no longer be actual physical pointers to memory. Windows Mobile programs that relied on this implementation detail in versions 6.x and before will fail when moved to the next version of Windows Mobile.

The Mobile Device Manager is mentioned in this article as a possible solution for authorizing, tracking, and collecting logs from mobile devices, assuming that you have an Active Directory infrastructure. MDM also requires a number of other products to fully function, including:

• Windows Mobile 6.1 on devices

• Windows Software Update Service (WSUS) 3.0

• Windows Mobile Device Management Server

• Enrollment Server

• Gateway Server

• Active Directory as part of Windows Server

• SQL Server 2005 or above

• Microsoft Certificate Authority

• Internet Information Server (IIS) 6.0

• .NET Framework 2.0 or above

•使用Windows Mobile API来获取内存和文件结构。不要在你得到任何一个句柄之后就直接获取他们。Windows CE 6.x版本(也就是下一个Windows Mobile的发布)使用虚拟内存模型,与之前的版本有不同的处理模型。这就意味着诸如文件句柄和指针之类的结构体并不指向真实的物理地址。基于这种的Windows Mobile程序在下一个Windows Mobile版本中失效。

•假设你拥有Active Directory Mobile Device Manager在本文中是作为授权、跟踪和收集日志的解决方案而提及的。MDM也需要一些其他产品来实现功能,包括:

Windows Mobile 6.1 的设备

Windows Software Update Service (WSUS) 3.0

Windows Mobile Device Management Server

Enrollment Server

Gateway Server

Active Directory as part of Windows Server

SQL Server 2005 以上版本

Microsoft Certificate Authority

Internet Information Server (IIS) 6.0

.NET Framework 2.0 or或以上版本

 

Windows Embedded

Consider the following guidelines if you are choosing a Windows Embedded technology:

If you are designing for a set-top box or other larger-footprint device, consider using Windows Embedded Standard.

If you are designing for a point-of-service (POS) device such as an automated teller machine (ATMs, customer-facing kiosks, or self-checkout systems), consider using Windows Embedded for Point of Service.

If you are designing for a GPS-enabled device or a device with navigation capabilities, consider using Microsoft Windows Embedded NavReady™. Note that Windows Embedded NavReady 2009 is built on Windows Mobile 5.0, while Windows Mobile version 6.1 is used in the latest versions for Windows Mobile Standard and Professional. If you are targeting a common codebase for NavReady and other Windows Mobile devices, be sure to verify that you are using APIs available on both platforms.

Windows Embedded

如果你选择了Windows Embedded技术,那么就考虑以下指导方针:

•如果你要设计一个机顶盒或者其他大设备,考虑使用Windows Embedded Standard

•如果你要设计一个POS机,例如ATM机,考虑使用Windows Embedded for Point of Service

•如果你要设计一个GPS设备或者具有导航功能的设备,考虑使用Microsoft Windows Embedded NavReady™。注意,Windows Embedded NavReady 2009是基于Windows Mobile 5.0的,而在最新的Windows Mobile Standard and Professional 中,使用的是Windows Mobile 6.1。如果你编写一个通用的代码库,在NavReadyWindows Mobile设备上都能使用,那么必须确保你使用了两种平台都可以调用的API

 

Additional Resources

For more information on the Windows Embedded technology options, see the Windows Embedded Developer Center at http://msdn.microsoft.com/en-us/embedded/default.aspx.

For the patterns & practices Mobile Client Software Factory,

see http://msdn.microsoft.com/en-us/library/aa480471.aspx

For information on the Microsoft Sync Framework,

see http://msdn.microsoft.com/enus/sync/default.aspx

For more information on the OpenNETCF.Diagnostics. EventLog in the Smart Device Framework see http://msdn.microsoft.com/en-us/library/aa446519.aspx

For more information on ASP.NET Mobile, see http://www.asp.net/mobile/road-map/

For more information on adding ASP.NET Mobile source code support into Visual Studio 2008,

See http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-netmobile-%20development-with-visual-studio-2008.aspx

额外资源

•更多Windows Embedded技术信息,请看Windows Embedded Developer Center

•模式和实践移动客户端软件工厂,请看Mobile Client Software Factory

Microsoft Sync Framework信息,请看http://msdn.microsoft.com/enus/sync/default.aspx

OpenNETCF.Diagnostics. EventLog信息,请看Instrumentation for .NET Compact Framework Applications

•更多ASP.NET Mobile信息,请参考Roadmap for ASP.NET Mobile Development

•更多Visual Studio 2008支持的ASP.NET Mobile源代码,参考:

http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-netmobile-%20development-with-visual-studio-2008.aspx

posted on 2009-01-19 20:15  施炯  阅读(533)  评论(0编辑  收藏  举报