| By Amit Chopra | Article Rating: |
|
| January 13, 2008 12:00 PM EST | Reads: |
6,610 |
The Device Security Manager
Continuing with our
effort to help you test your code more efficiently, the second
trickiest area developers had to deal with was executing code on
devices with different security configurations. Every device developer
at some point will realize that the certificates and security policies
on the device control code execution. While we can't simplify those
policies and processes, we can certainly provide tools that make it
easier to understand and deal with these challenges. One way to deal
with them is to have lots of devices in your test labs with different
security configurations and test your applications on each of them. A
simpler and cheaper way is to take advantage of the new Device Security
Manager in Visual Studio 2008 that can change the security
configuration for your target device at a click of a button so that you
can quickly test your applications on different security settings and
configurations (see Figure 5).
This tool can be launched from the Tools Menu followed by clicking Device Security Manager. In Figure 6 you can see that this tool is currently connected to a Windows Mobile 5 Smartphone Emulator and displaying the security configuration it currently has.
Emulator images usually ship with an unlocked security configuration that makes it easy to deploy and test applications; real devices will very likely be one of the other configurations listed on the screen. To see the effect of how your application will behave in a different configuration all you have to do is select the configuration of interest and deploy to the device.
In a matter of a few seconds that emulator image will be provisioned to work like a two-tier device and when you run your application you'll experience exactly what your customers do using a similarly configured device, all without you having to build an inventory of real devices.
Automation in the Device
Emulator Manager
The Device Emulator Manager
first shipped with Visual Studio 2005. It made it easy to see all the
emulator images on your machine and provided the ability to quickly
launch and cradle emulator images. Clearly that was useful, but manual
in nature. Every time you had to launch or cradle or shut down and
image, you had to manually do these tasks using the Device Emulator
Manager. In Visual Studio 2008 the Device Emulator Manager can be fully
automated, which means you can write simple scripts or code that you
can run in conjunction with your unit tests to connect and disconnect
one emulator after another.
Another enhancement in the Device Emulator Manager also makes it simple to clone emulator images. Once you have an emulator running, right-click on that node and select "Save As" shown in Figure 7.
This will prompt you to save the configuration of the emulator in a simple XML file in the "My Device Emulators" folder. It will also show this new emulator in the Device Emulator Manager. You can then edit this file to change the characteristics of the emulator and quickly build a list of emulators with various configurations.
Device Emulator Enhancements
The version of Device
Emulator that ships with Visual Studio 2008 is version 3.0. Version 2.0
of the emulator shipped with the Window Mobile 6 SDKs and was also made
available for download standalone from Microsoft Downloads. The
performance gains should certainly be the most visible benefit to all
developers moving from Version 1.0. But apart from working on
performance Device Emulator also added capabilities to emulator
hardware and peripherals such as battery, speakerphone, headset, and
car kit.
Of all these features, Battery Emulation has been my favorite. I recollect talking to many developers who had to wait for hours for device batteries to drain enough to test how their code worked in low-battery conditions. For example, when the battery in the device went down, say, 20%, they wanted to start saving some critical data gracefully. The only way to test this before was with a real device - waiting patiently for that moment of joy when the battery level hit the desired level. The Device Emulator makes it a charm to test these scenarios. Coupled with the new state and notification APIs in Windows Mobile, you can use the Device Emulator to send a low-battery signal to the Emulator Image, which will then send a notification to your application to handle that event. And in a matter of seconds you'll be able to test the behavior of your application under different battery conditions (see Figure 8).
And to make things even easier in Version 3.0 you don't have to launch the properties page manually to change the battery state. You can now automate that part too. Just like the Device Emulator Manager, the Device Emulator supports automation and using a script or code you can alter the battery state while your application and emulator are running.
A Broad Choice of Supported Platforms
Visual
Studio 2008 provides the most comprehensive choice of Windows Mobile
and CE platforms for developers to target and continue to support both
managed (VB, C#) and native (C++) development. Along with the Pocket PC
2003 and Smartphone 2003 SDKs that we shipped in Visual Studio 2005, we
now also include the Windows Mobile 5.0 SDKs in the box. To develop for
Window Mobile 6, you just have to download the most recent SDK from the
Web and it will plug into Visual Studio 2008. In Visual Studio 2008,
Smartphone 2003 is for a native project only since .NET Compact
Framework 1.0 projects aren't supported and Smartphone 2003 only
supports a .NET CF 1.0 runtime. If however you have any projects that
you want to open, Visual Studio 2008 will migrate them to work on
Windows Mobile 5.0 Smartphone using the .NET CF 2.0 runtime.
Visual Studio 2008 also introduces a more usable version of the new project dialog designed to make it easier to navigate multiple SDKs, runtimes, and application types as well as a link to help discover new SDKs and emulator images.
As you can see in Figure 9, we allow the ability to select a platform, select a version of .NET Compact Framework (2.0 or 3.5), and the application type all from one single screen.
And the best part of Visual Studio 2008 is that it will work perfectly well with Visual Studio 2005 side-by-side on the same machine to help make a smooth transition from 2005 to 2008.
Conclusion
I hope that with this article I was
able to highlight how Visual Studio 2008 will greatly impact your
ability to ship robust device applications faster to your customer and
demonstrate a potential way to save the cost of procuring expensive
devices by using the emulator and other features instead.
Our team will be glad to hear your feedback and thoughts on how we can continue to help provide you with the best development experience for smart device development. You can reach us using our team blog at http://blogs.msdn.com/vsdteam/, provide feedback using device forums at http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=11&SiteID=1, or by using the Connect Feedback System at http://connect.microsoft.com/default.aspx.
Published January 13, 2008 Reads 6,610
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Amit Chopra
Amit Chopra is the release program manager for the Visual Studio for
Devices team. He also manages the sustained engineering efforts for
eMbedded Visual C++ 4.0 and Visual Studio 2003. He can be contacted at achopra@microsoft.com.
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- How PowerBuilder Got Its Groove Back
- The Cloud Has Cross-Border Ambitions
- Ulitzer Names The World's 30 Most Influential Virtualization Bloggers
- Ulitzer Named "New Media" Partner of Greatly Anticipated iStrategy Event in Berlin
- Risks and Enterprise Mobility?
- Steps for Success in Enterprise Mobility?
- Are Mobile Luddites Resisting Mobility?
- The Difference Between Web Hosting and Cloud Computing
- Sybase CTO to Speak at 4th International Cloud Computing Expo
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- Five Reasons to Choose a Private Cloud
- Seeding The Cloud: The Future of Data Management
- The Threat Behind the Firewall
- Economy Drives Adoption of Virtual Lab Technology
- Tips for Efficient PaaS Application Design
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- Where Are RIA Technologies Headed in 2008?
- PowerBuilder History - How Did It Evolve?
- The Top 250 Players in the Cloud Computing Ecosystem
- Custom Common Dialogs Using SetWindowsHookEx
- DDDW Tips and Tricks
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Book Excerpt: Sybase Adaptive Server Anywhere
- Sybase ASE 12.5 Performance and Tuning
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App
- Dynamically Creating DataWindow Objects






























