Windows Phone 7 app development - 7 interesting points to know before you start
Join the DZone community and get the full member experience.Join For Free
I've been developing for Windows Phone 7 since the SDK was in the beta stage. Although the whole development process revolves around the same .NET Framework and it shouldn't be too big of a problem to get a head start if you have prior .NET development experience, but there are some interesting aspects that I tried to outline in this article. Hopefully you will find these helpful if you are just starting developing apps for WP7.
Silverlight for Windows Phone 7 != Full-sized Silverlight
Silverlight for WP7 is much more restricted compared to Silverlight used to develop RIA solutions. Yes, it still has the XAML markup available for the UI, but when you start working with code, you can see that some class libraries are not available in your Windows Phone 7 application. Also, if a DLL works in a Silverlight application, it doesn't mean it will work in a Silverlight-based Windows Phone 7 app.
Developing without an actual phone isn't going to help in the long-run
The emulator that is distributed with the SDK does a pretty good job at emulating the processes that go in the system itself when your application is running. If your application isn't running correctly in the emulator, this most likely means that it won't run correctly on the phone either. If it does run pretty well, you still need to test it on an actual phone before making it public, and there are a few reasons for this. First of all, some components will only work on the phone, like the radio, camera, location services and real multitouch. The second reason is performance and you have to make sure that the app isn't wasting too many resources when it is ran on actual hardware. This includes (but not limited to) battery and data consumption - these are critical for the user and if an app acts "irresponsible" towards these resources, chances are it won't be used for long.
It's all about async
Windows Phone 7 doesn't support many synchronous operations - most of the activity is done asynchronously. Have you ever worked with HttpWebRequest or WebClient in a desktop application? If so, then you probably worked with methods tied to those classes in a synchronous manner. This won't be possible on Windows Phone 7 and the main reason for this is performance - no process should generally hang the application and a synchronous operation might just do that. Make sure that you know how to work with IAsyncResult and async callbacks.
WMAppManifest.xml - yes, you should look there
When your application will be submitted to the marketplace, this will be the file that will define the application capabilities.
Before submitting the application to marketplace, please, review the required capabilities. It isn't nice to see a flashlight app require gamer serivices, microphone and location - after all, why would it need this? The list of capabilities might make the difference when the user decides whether to download the app or not.
Don't hesitate to read additional documentation and look at samples
MSDN isn't the limit when it comes to WP7 developer documentation and samples. Here are a couple of other readings and downloads that might be useful for any WP7 developer:
- Creating High Performing Silverlight Applications for Windows Phone Samples
- Windows Phone Marketplace Anti-Piracy Model white paper
- Programming Windows Phone 7 by Charles Petzold
- Windows Phone 7 Application Certification Requirements
- Frequently Asked Questions Ads in Windows Phone 7 Apps for Developers
- Windows Phone 7 Training Kit for Developers - RTM Refresh
Don't forget about interoperability
You can use XNA libraries in Silverlight-based applications and vice-versa. This is extremely useful when you want to work with various non-standard UI elements like message and input boxes.
Expression Blend helps a lot when it comes to animations
Working with XAML is fun, but sometimes the animations you need to implement are so complex, that you might need some help. Expression Blend is great when it comes to easily organizing complex UI manipulation scenarios - something that might take hours when you work and test XAML by hand. Besides, it comes free with the SDK.
Opinions expressed by DZone contributors are their own.