New features provided by Windows Mobile 6 for developers (3)

Source: Internet
Author: User
Tags management studio sql server management sql server management studio microsoft c
ArticleDirectory
    • Best security practices
    • Unified API set on all devices
    • Device Simulation
    • Visual Studio 2005 is supported during design
    • Runtime and API support
    • Improved appearance
    • Provide new input options through the new handwriting API
    • Enhanced audio experience through new sound APIs
    • New Device status information
    • Managed Application Development
    • Local Application Development
    • Database Application Development
Build an application running on many devices Program

The flexibility and strong programmability of Windows Mobile devices allow more and more people to use them for various purposes. Because it is so widely used, there is no device appearance that can be applied to everyone. To meet such diverse user needs, Windows Mobile devices provide a variety of appearances. Table 4 shows the appearance of some common Windows Mobile devices.

Table 4. Appearance of common Windows Mobile Devices
Dimensions Resolution Touch Screen

176x220

96 DPI

None

240x320

131 DPI

None

320x240

131 DPI

None

320x320 *

128 DPI

Yes

240x320/320x240

96 DPI

Yes

480x640/640x480

192 DPI

Yes

240x240

96 DPI

Yes

480x480

192 DPI

Yes

* Resolution added in Windows Mobile 6

Because there are so many kinds of appearance styles available, you must ensure that the built application can adapt to the differences in the appearance styles of the device. You need to remember that the content of the visual styling list supported by Windows Mobile devices is constantly expanding. Windows Mobile 6 includes many new features and resources to reduce the workload required to build applications that can easily adapt to different appearances. You will find that Windows Mobile 6 makes it easier to build applications that can take advantage of the specific capabilities of each device and work smoothly on the appearance of multiple devices.

Note:

The 320x320 display exterior shape introduces a new resolution and a display area slightly different from the previous exterior shape. Make sure that the new appearance is included in your application test; otherwise, it differs from other styles, which may lead to difficulties for applications to display on devices that use the styles.

Best security practices

The original Windows Mobile Pocket PC device had very few device security features. With the maturity of the platform, its security is also increasing. The trend of improving Windows Mobile platform security may continue. To minimize compatibility issues with future versions of Windows Mobile, You need to integrate only a few security best practices into your applications.

Your application should only write content to the folder where the executable files of the application are located or to the My Documents folder. In the future, special permissions may be required to write content to folders other than these folders. When writing to the Registry, only content is written to the HKEY_CURRENT_USER Configuration unit. Similar to a file system, you may need special permissions to write content to other areas of the registry at a certain time in the future.

Unified API set on all devices

Windows Mobile provides a unified API set for all windows mobile devices. This is a key factor that makes it practical to build executable files for a single application that can work on all Windows Mobile devices. On all Windows Mobile devices, Win32 API and. NET Compact Framework 2.0 are both comprehensive and consistent. Having a consistent API set reduces the work required to manage and distribute separate executable files for different device types.

One area that requires special consideration is device display. The rest of this section will be devoted to this.

Device Simulation

A device simulator is one of the most important tools for developing applications that can run successfully on devices with different appearances. With the help of device simulators, you can test applications on many devices with different appearances without accessing physical devices with these appearances. Visual Studio 2005 and the Windows Mobile 6 SDK provide more than 25 simulator images, allowing you to fully test the behavior of applications on devices with multiple appearances. For an example of the appearance of multiple devices supported by this simulator, see Figure 15.

Figure 15. Appearance examples of several device Simulators

Visual Studio 2005 is supported during design

The Visual Studio 2005 Form Designer provides an easy-to-use application user interface construction mechanism. When using this designer, you can see the result immediately after creating and modifying the appearance of the form. This WYSIWYG design experience is not limited to applications that use static user interfaces. Visual Studio 2005 Form Designer can recognize the appearance of an application form. This feature saves a lot of time because it allows you to see the effects of different appearances without executing an application.

To view the Display Effect of the form during vertical and horizontal rotation, right-click the form and rotate the Form 90 degrees to the right or left. You can click the form again to rotate it back to the vertical display. Figure 16 shows a form in the Visual Studio 2005 Form Designer that rotates vertically and horizontally.

Figure 16. Use the Visual Studio 2005 Form Designer to view the changes in the form layout During vertical and horizontal rotation

To view other Display sizes and display resolution changes, Visual Studio 2005 provides a design-only attribute "appearance setting ".

When a new "appearance setting" value is selected, the Visual Studio 2005 Form Designer displays the form as it appears in the selected appearance. Figure 17 shows how the form in Figure 16 looks when "Windows Mobile 6 Professional square" (Windows Mobile 6 Professional square) is selected. Note that a scroll bar is added to display the controls at the bottom of the form.

Figure 17. view the form in Figure 16 in square appearance settings in Visual Studio 2005 Form Designer

Runtime and API support

Differences in the appearance and shape of devices are essential for the development of Windows Mobile applications. To help you support different device appearances, the. NET Compact Framework 2.0 class and runtime provide built-in support for Dynamic Responses to device appearances. Similarly, local application developers have several APIs that can provide similar support.

Hosting applications

. NET Compact Framework 2.0 provides several new features for hosted applications that enable the runtime to automatically adjust the widget size and location: Control dock, control positioning, automatic scrolling, and automatic scaling. The docked control is placed by an edge of its parent control and fills the entire area along the edge. In response to the differences in the display size, the control automatically adjusts its size to always fill the entire edge of the parent control. See the example of the Dock Control in Figure 11 above.

The positioning control maintains a fixed Distance between one or more edges of the control and the edges of the parent control. In response to the differences in the display size, the positioning control automatically adjusts its own size to maintain a proper distance between the positioning side of the control and the edge of the parent control. The positioning control is displayed in Figure 12 above this article.

. NET Compact Framework 2.0 provides the auto-scroll and auto-zoom functions through the autoscroll and autoscalemode attributes on the Form Control. When the autoscroll attribute of the form is set to true, the form automatically adds a scroll bar when the display size changes and some controls of the form cannot be seen. The differences in the appearance and shape of the device are not limited to the changes in the size. The resolutions of the appearances of different devices may also be different. The difference in the device resolution may cause the control of the application form to appear very small or very large. By setting the autoscalemode attribute of the form to autoscalemode. DPI, the form control automatically scales its size so that it can be correctly displayed at different display resolutions.

Local Applications

Microsoft C ++ provides over 20 functions and macros to handle common tasks related to adapting to display differences between devices, although this is not a new feature for Windows Mobile 6. You can find them in the deviceresolutionaware. h header file in the % Program Files % \ Microsoft Visual Studio 8 \ Vc \ ce \ atlmfc \ include folder. Table 5 shows only a few of the above functions and macros.

Table 5. Some self-owned functions and macros that can help adapt to device display differences
Function or macro Description

Getdisplaymode

Returns the vertical, horizontal, or square value that identifies the current display direction.

Scalex, scaley, scalerect, scalept

Adjust the value as needed to adapt to the current display resolution.

Stretchicon

Adjust the Icon size to fit the current display area.

Relayoutdialog

Copy data from one dialog box to another. It is helpful when you change the display direction of the device in the displayed dialog box. This allows the application to display another dialog box with the same control as the original dialog box, but its size is more suitable for the current resolution.

Fixupdialogitem

Solve common problems that may occur when the application change dialog box is large. For example, when the ListBox control or ComboBox control is selected to scroll out of the display area, it will scroll into the field of view.

Supported Resources

Microsoft provides several resources to help you reduce the time it takes to incorporate styling capabilities into your applications. These resources describe many best practices to be followed when implementing applications. These resources also provide some effectiveCodeTo handle many common problems related to device differences. This code can not only be used as an example of how to solve the differences in the appearance of the device, but also be incorporated into the application and immediately exploited.

Resources for hosting application developers

The Microsoft patterns and Implementation Solutions team provides mobile client software factories for hosted application developers. The mobile client software factory is the best practice for dealing with many of the most common situations faced by mobile developers,Source codeA combination of components and examples. To deal with the differences in the appearance and shape of devices, the mobile client software factory provides orientationawarecontrol. Orientationawarecontrol works with Visual Studio 2005, allowing you to create a graphical layout for controls that contain one or more child controls; one part of the control layout definition is to define different la s for different appearances.

When orientationawarecontrol is used, the layout of the control is first defined according to the desired appearance of the control in a shape. Then, in Visual Studio 2005, change the appearance of the widget to learn how to view the new appearance. If you are not satisfied with the appearance of the control you want to view on the new exterior styling, you can adjust the new exterior styling layout of the control without affecting the layout of the original exterior styling of the control. Controls retain independent layout information for each of the different appearances for running. When the application is running, orientationawarecontrol is displayed in a layout suitable for the current appearance. For example, if an application is running on a device with a display size of 240x320, A 96 dpi resolution, and a portrait orientation, orientationawarecontrol uses the layout you have defined for the 240x320 display size, 96 dpi resolution, and vertical direction. If you rotate the device horizontally, orientationawarecontrol displays the display size for 320x240, 96 dpi resolution, and horizontal layout. Orientationawarecontrol works similarly to display resolution and size changes.

Another important resource for hosting application developers is the mobile industry's solution accelerator toolkit. This toolkit provides lob developers with resources to demonstrate how to build a Windows Mobile lob application. The toolkit contains complete source code with detailed comments, sample database, and more than 100 pages of documentation. This toolkit includes application components for users with different roles (including customer service, warehouse workers, and delivery drivers) as target users. In addition to providing application development guidance, this Toolkit also includes best practices for successfully deploying mobile lob applications on an enterprise scale.

Resources for local application developers

The Windows Mobile 6 SDK includes a uilayout example for local application developers. This example demonstrates how to implement a local application that automatically adjusts the user interface to adapt to device display differences. The screenlib class in this example provides many methods (including the methods used to dock controls, locate controls, align controls, optimize the layout of application controls, and many other methods) complete a lot of work related to the user interface. The screenlib class is designed to be reusable. Therefore, this class can be directly incorporated into your own applications and used to provide many functions.

Regular Resources

For the latest information about building an application that can work effectively on the appearance of a full range of Windows Mobile devices, visit the Windows Mobile resize your application page. The "adjust your applications on Windows Mobile" page is your one-stop resource library, it provides all content related to the development of Tunable Windows Mobile applications (including White Papers, web broadcasts, announcements, and other content ).

Back to Top

Enhance User Experience

Windows Mobile 6 provides new features that focus on enhancing user experience. These features provide developers with the opportunity to improve their application availability by providing new user interaction methods and responses to device status changes.

Improved appearance

Windows Mobile 6 completely reconstructed the appearance of the device. Display is much clearer and simpler than the old version. One of the most significant changes is the pocket outlook screen. These screens not only provide clearer and concise display, but also simplify information viewing and navigation. You only need to run on Windows Mobile 6 without making any changes, and your applications will benefit from most of the above improvements.

Windows Mobile provides many standard dialog forms, including the contact selection dialog box and message transmission form. The standard dialog box used in your application is the same as the form used in pocket outlook, therefore, they have the same improved appearance when viewed in your application and directly used in pocket outlook. Similarly, the image selection dialog box also benefits from overall display improvement. This is also true for applications that use the. NET Compact Framework 2.0 documentlist class for users to find and open files. Figure 18 shows the new Windows Mobile 6 Image Selection dialog box.

Figure 18. New Windows Mobile 6 Image Selection dialog box

Similarly, the image selection dialog box also benefits from overall display improvement. This is also true for applications that use the. NET Compact Framework 2.0 documentlist class for users to find and open files.

Provide new input options through the new handwriting API

Windows Mobile 6 includes a lightweight Tablet PC wisp handwritten API called wisp lite. Wisp lite provides a wide range of hand-writing functions for all Windows Mobile 6 classic and Windows Mobile 6 professional devices, which are powerful and flexible. Wisp Lite is fully compatible with tablet PC handwritten data and includes APIs for handwritten content collection, recognition, presentation, and handwriting data management. Wisp lite provides a much higher fidelity experience than the previous richink control.

Enhanced audio experience through new sound APIs

Windows Mobile 6 includes a set of new sound API sets that can play a large number of audio file formats that were not previously supported. The new sound API can play MP3, mid, WMA, and WAV Files. In response to developers' requirements, the new sound API includes the option to accept the device configuration file so that the device is set to mute or vibrate without playing the sound.

New sound APIs include functions used to retrieve sound files associated with common events (such as known caller phone ringtones or roaming phone ringtones; you can also change the audio files associated with these events. You can play audio files synchronously or asynchronously. You can also enable the API to notify the application at the end of asynchronous playback. The new API also includes functions for searching the location of sound files in Ram, Rom, and installed memory cards.

New Device status information

The status and notification proxy enables applications to learn about device status changes and intelligently respond to these changes. In addition to more than 5.0 "status and notification proxy" Status values supported by Windows Mobile 100, Windows Mobile 6 adds several additional status values. Windows Mobile 6 provides status information for Internet-based voice (VoIP) telephone calls, including phone numbers, carrier names, and other information. Windows Mobile 6 also adds the locked status information. The system provides information about the keyboard lock status, device lock status, and SIM lock status changes.

Back to Top

Start building the content required for the Windows Mobile 6 Application

It is easy to develop applications for Windows Mobile 6. In fact, most of you have met most of the development requirements.

To develop the first Windows Mobile 6 application, you need to install several software. This section describes the list of required software and whether each software is required, recommended or optional. A brief description of the use of each software is also provided.

Required Software Required/optional Description

Visual Studio 2005 Standard Edition, Professional Edition, or team system

Required

Visual Studio 2005 is a development environment used to create windows mobile applications.

Windows Mobile 6 Professional SDK or Windows Mobile 6 standard SDK

Required

Provides the tools, header files, simulator images, and Visual Studio 2005 project types required to develop Windows Mobile 6 applications.

ActiveSync 4.5 or later (XP) or Windows Mobile Device Center (Vista)

Required

Provides the connectivity required to connect to a Windows Mobile 6 simulator image or device.

Visual Studio 2005 Service Pack 1

Optional (Windows XP)

Required (Windows Vista)

Add minor corrections and update all data-oriented dialogs in Visual Studio 2005 to display the SQL Server compact edition product name. For Windows Vista users, to enable Visual Studio 2005 to run on Windows Vista, the service package update must be installed.

. NET Compact Framework 2.0 Service Pack 1

Recommendation

If this service package is not available, Visual Studio 2005 deploys. NET Compact Framework 2.0 to a Windows Mobile 6 device each time an application is deployed. Support for Command Line Debugging is also added, and a new utility is provided to review the performance data provided by. NET Compact Framework 2.0 runtime.

SQL Server 2005 compact edition tools for Visual Studio 2005

Optional

Provides the tools and assembly required for the development of Windows Mobile 6 applications using SQL Server 2005 compact edition. Install Visual Studio 2005 SP1 before installing this tool.

Back to Top

Make full use of existing skills

If you have ever created a Windows desktop computer application or server application, even if you have never created a Windows Mobile Application before, you also have the skills required to develop Windows Mobile 6 applications. One factor that makes it easier to start building a Windows Mobile 6 application is Visual Studio 2005. Creating a Windows Mobile 6 Application in Visual Studio 2005 is similar to building a desktop Windows Forms Application. When developing a Windows Mobile 6 Application, Visual Studio 2005 has the same behavior and features as when developing a desktop application.

Managed Application Development

If you are a hosted application developer, you will find that. NET Compact Framework 2.0 provides the same classes as those used when creating desktop applications. These classes are complete.. NET Framework class .. NET Compact Framework 2.0 also provides many controls that are the same as windows form controls used when building desktop applications. These controls provide the same experience that you are familiar with when developing desktop applications.

Local Application Development

The core API of Windows Mobile 6 is Win32. Although it is a subset, it is the same as Win32 on a desktop computer. Similarly, the Active Template Library (ATL) and Microsoft basic class (MFC) are available, both of which are a rich subset of the corresponding items of their desktop computers. You will also find that many c \ c ++ codes written for desktop applications are compatible with Windows Mobile 6. This is because Visual Studio 2005 uses the same front-end C \ c ++ compiler for desktop applications and Windows Mobile Device Applications.

Database Application Development

You will also find that, skills and experience in developing database applications for SQL Server 2000 and SQL Server 2005 can be easily converted into skills and experience in developing SQL Server 2005 compact edition applications. SQL Server compact edition SQL syntax is fully compatible with SQL Server 2005. Similarly, the ADO. NET and oledb programming interfaces for SQL Server compact edition are consistent with those for SQL Server 2005. Even the method of creating and managing SQL Server compact edition databases is quite familiar, because the SQL Server Management studio tool used to create and manage the SQL Server compact edition database is the same as the SQL Server Management studio tool used to create and manage the SQL Server 2005 database.

Back to Top

Guidance

Microsoft provides many resources to provide you with the guidance you need to build high-quality applications on the Windows Mobile 6 platform. In addition to product documentation, you can also find information on Windows Mobile Application Development and best practices for successful development on Windows Mobile.

Windows Mobile pages on msdn are mostly the best starting position. It provides the latest information about Windows Mobile development. The Windows Mobile Page on msdn also contains pointers to other resources (such as White Papers, helpful blogs, and network broadcasts.

The Microsoft mode and implementation solution team provides great guidance to Windows Mobile developers at the mobile client software factory. The mobile client software factory is a comprehensive set of best practices, examples, source code, and tools for Windows Mobile developers. Topics covered include processing differences in the appearance of devices, offline data management, data synchronization, and management of large-scale applications.

Windows Mobile isCommunitySupported projects. Windows Mobile wiki is an excellent way to benefit from the knowledge and experience of other developers. You will find that this Wiki is designed to solve many of the most common problems.

The Windows Mobile newsgroup is a community-supported resource in which you can raise questions about Windows Mobile development and bring them to the industry (including many Windows Mobile Microsoft valued shortsionals (MVP )) answer these questions.

Windows Mobile adjusts your applications page to provide up-to-date information about issues related to developing applications that can work on a full range of Windows Mobile devices. You will find pointers to news, announcements, network broadcasts, and white papers dedicated to these issues.

Back to Top

Conclusion

Windows Mobile 6 provides the tools and functions required by developers to develop and deploy powerful mobile industry applications. Add it to the ROM of all Windows Mobile 6 devices. NET Compact Framework 2.0 SP1 and SQL Server 2005 compact edition provide a powerful application platform that simplifies application deployment. Other tools attached to device emulator 2.0 and the Windows Mobile 6 SDK provide the ability to more easily test applications based on features and appearances of a variety of Windows Mobile devices, it simplifies the development process of applications that can run on many different devices. The Windows Mobile 6 SDK contains more than 100 examples, patterns, and implementation solutions. The combination of the mobile client software factory and the mobile industry solution accelerator toolkit is designed to provide the guidance needed to immediately start industrial application development..

Whether you are an experienced Windows Mobile developer or preparing to develop the first Windows Mobile project, you will find that Windows Mobile 6 is the best Windows Mobile platform for industrial application development.

For more information, see

Other resources

Windows Mobile Developer Center: security, deployment, and management

Mobile2market FAQs

Mobile client software factory

Mobile Industry Solution accelerator Toolkit

Windows Mobile adjusts your application page

Msdn Windows Mobile Page

Windows Mobile developer newsgroup

2007 Microsoft Corporation is copyrighted. All rights reserved. Usage rules.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.