Time Saving Tips to Get Your Windows Phone App Started
Now that you have your development environment set up and ready to go (in case you’ve missed it, check out my earlier post, Setting Up Your Windows Phone Development Environment in 30 Minutes (or less)), let’s go over the ways that Visual Studio can easily get you started without having to dig too deep into documentation.
As you know, every development opportunity in Visual Studio 2012 begins with File > New Project. With the Windows Phone SDK installed, you will notice that once you have the New Project dialog open, you have a good selection of templates to choose from.
To save you the time looking up each one, allow me to summarize of what you should know about each:
- Windows Phone Databound App – use this template when creating a project that will retrieve and display data from a source, such as a local database, cloud storage, or a web service. This project generates a basic MVVM structure, including a main page view and details page view and sample data that is bound to both views.
- Windows Phone Panorama App – similar to the Databound App template, except its content spans across a single panorama page, which the user glides across to navigate, providing a fluid user experience. The Toronto Events app, by fellow community expert Andrei Marukovich, demonstrates a really nice implementation of the panorama page.
- Windows Phone Pivot App – similar to the Databound App template, except content is categorized across pivot items, which the user can swipe across to navigate through. I’ve used the pivot template in a few of my apps.
- Windows Phone XAML and Direct3D App – use this template when you want to do really cool things in your app with Direct3D, even if you’re not a native developer. This allows you to create a managed application using native components to include the power of Direct3D within your app.
- Windows Phone Direct3D App (Native) – use this template if you are a native developer that wants to create a graphics intensive app that targets multiple platforms.
- Windows Phone XAML and XNA App – use this template when you want to create a two-dimensional game. Sudoku, checkers, tic-tac-toe, any card game imaginable… you get the idea. Any project developed as an XNA app will appear with the Games Hub on the user’s device when installed.
- Windows Phone HTML5 App – use this template when creating an HTML5 app. Although HTML5 doesn’t run as a native app on the device, you can create an HTML5 app and render it through the provided WebBrowser control. This project sets up the default page view, html page, and basic wiring to get you started. Although the example demonstrates a local web page, you can also use the control to render external web pages or dynamically generated web content. Since the WebBrowser control is based on IE10, it gives you the full power of the desktop browser on the device, providing support for open standards, and scripting.
Each of these templates provide a working project right out of the box. Once the project loads, you can run it immediately without having to make any changes. This gives you the opportunity to decide if it’s the right style for your app idea before you even begin development, which is a huge time saving feature!
These sample projects also serve as a great learning tool! In each project, you can use the code that’s in place to learn how to:
- Design the application architecture
- Wire up your pages for navigation
- Bind your page elements to your object model
- Create a basic application bar
- Set up localization
- ….and more!
The Windows Phone SDK provides APIs for everything…and I mean EVERY thing! You can include sophisticated functionality in your app using just a few lines of code.
Camera integration? There’s an API for that! For a deep dive on that, as well as photos and media support, have a look at Chapter 7 of Windows Phone 8 Recipes.
Maps and navigation? There’s an API for that too! Again, a deep dive can be found in Windows Phone 8 Recipes. Chapter 8 this time.
Last but certainly not least, contacts and calendar integration, speech recognition, Bluetooth and NFC are all simple to use with the APIs in the Windows Phone SDK.
I can go on for a while about this topic, because the list of available APIs is intentionally made to be quite extensive. Although it may seem like a lot to learn, these APIs can be implemented quickly and easily. More importantly, you only need to learn them when you need to use them! No sense of going through all of them if your app idea doesn’t actually need to implement them.
If you’re looking for sample projects to demonstrate how these features can be incorporated into your apps, you’ll find them in the book. You can also find a wealth of information and sample projects within the Windows Phone Developer Centre.
Last but not least, let’s talk security. Essentially, the Windows Phone platform itself handles a lot of the tedious, but necessary, security aspects for app developers. Mark Artega provided an excellent post about application platform security which is worth reading.
Also, if you plan on creating apps that store sensitive user data, then you will want to include data encryption in your application. The Data Protection API makes this easy for you. Mark followed up with a second, yet just as excellent, post on this topic, and <lastShamelessPlug>I covered it in Chapter 11 as well</lastShamelessPlug>.
- I CAN create a project using one of the many provided templates, which lets me plug in my data, and get a basic app running in minutes.
- I CAN use the sample projects as a learning tool which will help me be more productive in less time.
- I CAN provide advanced functionality in my app with only a few lines of code.
- I CAN incorporate data encryption quickly and easily.
- I WILL build an app in record time!
Next, we will talk about how to monetize your newly developed app so that you can start reaping the benefits of your hard work!
1 translation for non-Redditors = Today I Learned