.NET Survival Guide: Mobile and Windows Phone 7
BACK TO .NET SURVIVAL GUIDE
Mobile and Windows Phone 7
After a watershed year in 2010, .NET developers can finally put their programming skills to use to create and sell apps for the Windows Phone 7 platform, introduced last February and available in Windows Phones in the United States since early November. The Windows Phone 7 OS, which is built on the .NET Compact Framework, severs ties with Windows Mobile 6.x. Instead, it runs out-of-browser apps created with managed code in Silverlight for Windows Phone. Game developers can also use XNA Game Studio to develop or port games that leverage Xbox Live functionality.
If you decide to test your skills in mobile, this is your chance to get your app into the Windows Phone Marketplace using familiar tooling and programming skills (C#, Visual Basic and XAML) to build event-driven applications in Silverlight for Windows Phone. Microsoft has indicated that 3,000 apps -- give or take -- have already been accepted into the Windows Phone Marketplace.
The first Windows Phones are targeted at consumers. Expect to hear more about the enterprise next month when Steve Ballmer gives a keynote at the Mobile World Congress. The current platform features an Office hub with Excel, Word, OneNote, SharePoint integration and networking in Silverlight, with WCF, HttpWebRequest and WebClient. WCF and LINQ are supported in the .NET Compact Framework, but not from customized data sources.
Microsoft is expected to offer updates to the Windows Phone 7 OS starting this month. According to developers with access to previews, copy-and-paste functionality is expected in the first upgrade. Microsoft has indicated plans to broaden network support beyond GSM to CDMA technology (Verizon and Sprint).
Devices from HTC, Samsung, LG Electronics and Dell that run on GSM networks (AT&T and T-Mobile) started to ship during the 2010 holiday season.
Porting smaller versions of Silverlight 4 apps to Windows Phone and code sharing among Silverlight applications is a benefit to developers who are already familiar with the platform. Attention to details around parity -- for example, IIS Streaming has a unique implementation on Windows Phone and behaves differently -- and understanding hardware limitations can help to minimize migration issues. Windows Phone at launch supports hardware-accelerated H.264 video with digital rights management.
Despite different manufacturers, Windows Phones are designed to offer consistent user experiences based on Microsoft hardware specifications: Qualcomm 1 GHz Cortex/Scorpion (Snapdragon) processor, 256MB RAM, 8GB Flash, DirectX 9 acceleration and 5MP camera. Developers can additionally tap into interfaces and sensors that support standard phone functionality such as Bing mapping and search, A-GPS, accelerometer (tilt and motion) and camera. The location API works with Windows Azure cloud services.
Challenges for developers may arise from the smaller screen displays (800x480 resolution [WGA] at launch), lack of access to native code in the OS or data storage in SQL Server Compact Framework -- part of the Windows Phone platform, according to Microsoft, but currently not surfaced for developers. Performance issues related to network connectivity, power management and memory usage also need to be taken into consideration.
Understanding the navigation framework and creative thinking around input mechanisms beyond the mouse and keyboard can increase your odds of success. Windows Phones support capacitive touchscreens with four contact points. If you're not familiar with multi-touch (Touch.Frame.Reported), now's the time to get started. Silverlight for Windows Phone supports a subset of the manipulation events in the Surface SDK.
Visual Basic for Windows Phone 7 Developer Tools was released in late November. The Visual Basic tools, which require Visual Studio 2010 Professional or higher, are targeted at Silverlight for Windows Phone development only -- Visual Basic doesn't support XNA. At press time, the Visual Basic templates for use in Visual Studio 2010 couldn't be shared with Expression Blend.
With the shift in Microsoft Silverlight strategy, .NET developers' mobile opportunities outside the Microsoft stack appear somewhat limited. Despite pleas from developers, Silverlight support on Android has not materialized. Android 2.2 has supported Flash 10.1 since last July. The .NET community can develop applications in C# in Visual Studio 2010 for Android-based devices starting this year. MonoDroid, a Novell (now Attachmate) plug-in to Visual Studio, is under development; version 1.0 is expected sometime in 2011. MonoTouch, which offers a way to build .NET applications on the Mac for the Apple iPhone, iPod Touch and iPad, was released in 2009.
Delivering Web content and LOB apps that are easily consumed by a myriad of mobile devices is a reality facing more enterprises in 2011. Mobile Web development continues to gain immediacy with the growing popularity of feature-rich smartphones and tablets such as the Apple iPad, which now serve as the primary gateway to the Internet for much of the workforce.
Developers who have stayed away from mobile app development and the mobile Web have no choice in 2011 but to prepare for the sea change ahead.
About the Author
Kathleen Richards is the editor of RedDevNews.com and executive editor of Visual Studio Magazine.