Part 4 in Susan’s series on building a Windows phone app from absolute scratch, in this post I figure out the differences between project types including pivot and panorama.
Did you miss part of the series? Check here!
Okay, I’ve installed the tools, I’ve done a Hello World application.l I want to start building my app now! So Go to Visual Studio 2010 | File | New Project and I see this…
There are 9 different project types just for Silverlight! (Quick aside: the XNA Game Studio 4.0 Phone projects are generally for games, and I am not going to try a game for my first app, but if you have played with XNA and are interested go for it and let me know how it goes, I’ve seen lots of cool windows phone games built by students!)
So which one should I use? Well I suppose I need to figure out the differences so here goes, I’ll dig through all the documentation and hopefully save you some time and effort doing the same.
Windows Phone Application
This creates a one page application. I checked and yes, you can add additional pages. You can’t get any simpler than this as a project type. So if your application is just going to be one or more screens and you will have the user navigate between them, this will work. Users will click on buttons or links to move between pages.
Windows Phone Databound Application
This creates a one page application, that has a listbox on the page and it implements the Model-View-ViewModel design pattern! Well that clears that up! Okay what the heck does that mean for me…apparently its a way to separate your data from your user interface. So basically you write a class that says what data you want to show in the application (that’s the Model part), then you design a control that will show the data (that’s the View part), then you write code that says which bits of data display in which parts of your control (that’s the ViewModel part). Users will click on buttons or links to move between pages.
So I would choose this type of project if I was designing an app that was going to get data from some sort of source and was going to be displaying this data to the user. I think the Where’s Timmy app that finds you the nearest Tim Hortons is an example of a Windows Phone Databound application.
Windows Phone Class Library
If you are planning to build multiple phone applications, and you write a clever piece of code that you want to be able to re-use in more than one phone app, put it into a Windows Phone Class library.
If you aren’t sure, you can always do this later. I have two apps I want to build this year, both of them will have a timer that counts down, so there is a probably a way I can make the logic that counts down the timer re-usable. But for my first app, I’m not going to worry too much about re-usability, I just want to get it working, I’ll probably go back and rework it a bit to make the code re-usable when I build my second app. But if you are one of those programmers who likes to make everything re-usable right from the get go, you could add a Windows Phone Class Library to your application right away to hold the code you want to use in other apps.
Windows Phone Panorama Application
Gives you a project with a panorama control. Well that doesn’t help if I don’t know what a Panorama control is! Luckily I have a co-worker who wrote a blog post on the difference between panorama and pivot and here’s what I learned from that post.
Forgetting the phone for a second, a panorama picture is one of those long horizontal pictures like this
On phones sometimes you scroll up and down, sometimes you scroll from left to right. Apparently they did research and figured out that it is more natural for our hands to scroll side to side instead of up and down (who knew!) Panorama applications are designed for sideways scrolling. When you do a panorama application you can make multiple pages appear on a single background. Users scroll side to side to see the different pages but the pages feel more integrated as you scroll across the content because you have a continuous background. It’s a really cool look and feel. You move from one page to the next as you scroll. It’s great for unstructured content, where you just want someone to explore by scrolling across to see what’s in the application. The red rectangle below gives you a sense of what the user sees on the screen. They can see just a fraction of the header and content for the second page so they can see that something is there and it encourages them to scroll and explore.
The IMDb app is an example of a Panorama app.
Windows Phone Pivot Application
According to MSDN a pivot application is a phone that uses a Pivot Control (and if you look up redundant in the dictionary it says see redundant). So back to Paul’s blog on Pivot vs Panorama.
Pivot applications scroll left to right just like panorama applications, but Pivot applications are usually more structured and data driven. If you think your user will expect specific menu items to choose from in the application, go with pivot. For example, when I open a twitter application, as a user I want to be able to choose between viewing my twitter feed, my Direct messages, and tweets that mention my twitter handle. Each of those will display a different list of data on my screen.
Another difference between a pivot and panorama control is that you can see the title of the next page. The user can scroll to move pages or tap the menu item to move to the that page. For example, if I built an app for the winter Olympics, when they are looking at Today’s events they can see from the title bar that scrolling will take them to the medals, or they can tap the word medals to move to that page.
You can’t see any content from the medals until you move to that page.
The Globe and Mail is a pivot application, so is the email application built into the phone.
These rules are not absolute! There is no rule that says you can’t show structured data in a panorama app. Check out the Facebook app, they went with Panorama, Twitter went with Pivot. I recommend checking out different panorama and pivot apps and seeing which you think best suits your app.
Windows Phone Silverlight and XNA Application
This creates a project that allows you to use Silverlight and XNA in the same application. This is something that lots of people wanted and was added in 7.5/Mango. You can also go the XNA Game Studio 4.0 project types and pick the same template. You get the same template either way. This template will give you an application with two pages: one Silverlight, and one Silverlight that shows XNA content. You also get a button to go from the Silverlight to the XNA.
Gamers like to use this project type because they use XNA for their games, but Silverlight is great for things like listing high scores, or letting users choose between levels.
Don’t dismiss it for non gaming applications! if you want to add cool 3D graphics to your application you’ll need XNA for that. Check out the application built by British Airways, it’s a great example of how using XNA can add some Wow to a Silverlight application.
Windows Phone Audio Playback Agent
Want to play music in the background? Do you want the option of having the music keep playing if someone leaves the application?
Adding this project to your application will give your application access to the classes you need to play audio files in the background.
Windows Phone Audio Streaming Agent
This is the same as the Windows Phone Audio Playback agent except you use it for streaming audio files.
Adding this project to your application will give your application access to the classes you need to play streamed audio files in the background.
Windows Phone Scheduled Task Agent
Do you want to have a scheduled task running in the background? Do you want to periodically check if there are new blog entries? DO you want to refresh data on the phone when the user has a network connection instead of over the data plan?
Adding a windows phone scheduled task agent gives you access to the classes that allow you to schedule tasks to run in the background at a particular time or under particular conditions (such as when the user has a network connection).
Wow, did that blog ever take me a long time to write! But I feel a lot better about my understanding of the project types now and hopefully I saved you some time with the summary. There are really 4 base project types: Phone Application, Phone Databound Application, Panorama, and Pivot. My first app is going to be a timer so I’m starting with a Phone application next blog I can start coding my app!
Join me on my quest to publish an app, and remember you could get cool stuff if you publish an app in Canada by May 20th, 2012.
Posted by If I can build a phone app anyone can! « Susanibach's Blog on January 3, 2012 at 3:37 PM
[…] Stuff Online « Happy Holidays from the HTML5 Angry Beaver! If I can build a Phone App anyone Can – What project type to choose? Pivot? Panorama? […]
Posted by Kromitvs on February 2, 2013 at 5:46 PM
What if you wanted to have music playing in background, after closing yourapp, but with a panorama layout? 🙂
Posted by susanibach on February 2, 2013 at 6:17 PM
Use the background agent 🙂
Posted by Kromitvs on February 3, 2013 at 8:02 AM
And I can add the panorama layout after?