Learn the Windows Phone 7 basics for your next app! Get to know:
• The Hardware architecture, the application platform, its framework.
• The deployment process.
• The application marketplace .
Intended for:CIOs, CTOs, IT Managers, IT Developers, Lead Developers
Presented by Philip Wheat, Microsoft Architec.
The Ultimate Guide to Choosing WordPress Pros and Cons
How to develop a WP7 app?
1. Philip Wheat Architect Evangelist -Startups Microsoft Corporation philwh@microsoft.com An Introduction to Windows Phone 7 Development Juan De Abreu VP -Delivery Director Common Sense jdeabreu@getcs.com
9. Hardware Architecture Capacitive touch 4 or more contact points Sensors A-GPS, Accelerometer, Compass, Light, Proximity Camera 5 mega pixels or more, flash required, camera button required 800 WVGA / 480 HVGA Multimedia Common detailed specs, Codec acceleration Memory 256MB RAM or more, 8GB Flash or more GPU DirectX 9 acceleration CPU ARMv7 Cortex/Scorpion or better Hardware buttons | Start, Search, Back 480 WVGA / 320 HVGA #CSwebinar
10. Elements of the application platform Tools Runtime – On “Screen” Phone Emulator Sensors Media Data Location Samples Documentation Xbox LIVE Notifications Phone Guides Community .NET Framework managed code sandbox Packaging and Verification Tools SCREEN CLOUD Portal Services Cloud Services Notifications App Deployment Registration Marketplace Validation MO and CC Billing Location Identity Feeds Certification Business Intelligence Maps Social Publishing Update Management #CSwebinar
11. Windows Phone 7 Framework Windows Phone Frameworks Camera Device Integration Launchers & Choosers Windows Phone Controls PhoneApplicationPage PushNotification WebBrowserControl Sensors PhoneApplicationFrame Silverlight Presentation and Media XNA Frameworks for Games Controls Drawing IsolatedStorage Drawing GamerServices Navigation Shapes Markup Media Audio Media Graphics Content Input Application Object Common Base Class Library Diagnostics Reflection IO Runtime Resources Globalization Text Location Net Collections ComponentModel Configuration Security Threading ServiceModel Linq #CSwebinar
13. Resources and Styles 4 Elements have a dictionary of resources identified by Key Can store arbitrary objects, not just UI objects {StaticResource} XAML directive does hierarchical lookup Code can access local element’s Resources dictionary resources styles Styles contain setters for Properties and Values Styles can derive from other styles Styles are applied explicitly by key or implicitly Can be changed dynamically to theme an application #CSwebinar
14. Built-in animation system Animation is driven by Storyboards Storyboard DoubleAnimation ColorAnimation PointAnimation etc animations can apply easing functions ~10 built-in (e.g. sine) + custom #CSwebinar
15. Common databinding system Elements have a DataContext Resolution of declarative bindings is done by hierarchically examining an element’s DataContext Grid Button #CSwebinar
18. Application structure Applications are built like web sites Functionality is split into pages Forward navigation via links Backward navigation via Back Users can navigate across different applications Previous applications (pages) are in the back stack #CSwebinar
19. UI Model: Familiar Web Concepts Phone application Provides UI represented as XAML pages connected into cross-app flows by URI’s Web application Provide media represented as HTTP resources linked by URL’s Shell frame Requests pages, renders UI, and handles navigation across apps Web browser Requests HTTP resources, renders them, and handles navigation across sites Sessions and back stack Groups together sequences of pages corresponding to a user’s activity across apps History and tabs Groups together sequences of HTTP resources corresponding to a user’s activity across sites #CSwebinar
20. Frame and Page PhoneApplicationFrame Exposes the screen orientation property Exposes a client area where pages are rendered Reserves space for the system tray and application bar Receives Obscured / Unobscured PhoneApplicationPage Fills the entire content region of the frame Optionally surfaces its own application bar Handles Orientation NavigatedTo and NavigatedFrom #CSwebinar
21. Page Navigation Forward Uri uri = new Uri(“/Page2.xaml”,UriKind.Relative); NavigationService.Navigate(uri); Back NavigationService.GoBack(); Hardware Back Button Handle BackKeyPress, OnBackKeyPressthen Navigate to where you would like*** #CSwebinar
25. … and some new ones! Panorama Bing Map Pivot #CSwebinar
26. Controls support touch Mouse Events Automatically converted for you SIP and WebBrowser control have gestures ScrollViewer Just like Silverlight So you now have FLICK and PAN for free! Raw Gestures Manipulations #CSwebinar
28. Text input TextBox integrates with the software keyboard Software keyboard supports input scoping Key InputScopes: EmailNameOrAddress Text Url Number Time TelephoneNumber PasswordBox has a 1 second delay #CSwebinar
29. INPUT SCOPES Utilizing the software input panel a.k.a. the SIP a.k.a. the on-screen keyboard demo #CSwebinar
31. Accelerometer +Y Measures force applied on each axis over time Simple API As easy as X, Y, Z! -Z +X +Z -Y #CSwebinar
32. Location: Sources of Location GPS + Accuracy - Power - Speed - Indoors - Accuracy + Power + Speed - Wilderness WiFi Location services +/- Accuracy +/- Power +/- Speed +/- Urban areas Cell towers #CSwebinar
33. Location services Smart device + cloud service Balance accuracy with time & power Consistent API across platforms No Emulator Support Reactive extensions for mocking #CSwebinar
38. Application Bar Toolbar Up to 4 icons Can set transparency level Slide up Menu can display more items Can declare in code or XAML Sample icons found under Program Filesicrosoft SDKsindows Phone7.0cons #CSwebinar
39. Application Bar Icons 48 pixels by 48 pixels Black or White foreground, transparent background Using alpha channel Circle will be added Choose icons with clear meanings Consider landscape mode (y-axis mirror images) Don’t add a back or home button! #CSwebinar
52. Lock screenLoad state to continue where you left off User is back where they left off Assume your process is killed Save state for later use #CSwebinar
56. Notification types 15 14 New photos online! Dallas, TX: Sunny and 80 degrees #CSwebinar
57. Push notifications: data flow Tile Push client Toast Open push channel Return URI Data to App Data to toast Data to tile App Send URI to server Send push data to client Your service Push service Send push data to URI Event #CSwebinar
66. Further information http://create.msdn.commarketplace, downloads, tutorials, videos and more! http://microsoftplatformready.comget your $99 back! http://chriskoenig.net/WP7Resourcesframeworks, databases, control tooklits, sample downloads and more http://delicious.com/chriskoenig/wp7links to interesting WP7 content http://bit.ly/WP7Forumssupport forums for Windows Phone 7 #CSwebinar
67. Calls to action 1 Install the Tools! 2 Start Coding! 3 Give us Feedback! #CSwebinar
68. Thanks! How can we help? philwh@microsoft.com PhilWheat.net @pwheat jdeabreu@getcs.com Blog.getcs.com @jdeabreu #CSwebinar
This presentation explains how to write Windows Phone 7 applications in Silverlight. It builds on top of assumed existing Silverlight skills (you should be familiar with things that can be done in Silverlight)
Windows Phone is a whole new kind of phone, targeted specifically at consumers, who work hard every day to balance their work lives and their personal lives. These were the key focus areas for our design and development effortsNew philosophy on what the device needs to doFocus on the end user, not on enterprises Improved “glanceable” design paradigm with “Metro”Standardized experience across all devices, manufacturers and all carriersStrong developer platform for building rich, interactive applications on the phone – a key part of our “3-screens and a cloud” strategyWindows Mobile Phones were essentially PPCs that got phone capabilities added to them. This device has been redesigned from the ground-up to be easy to use, incorporate the things you do and care about, and give you the information you need quickly and easily.Depending on the size of the crowd, I also ask about the screen shot here and ask for their feedback.
After talking to developers and customers since the Mobile World Congress, early 2010, it is clear that Windows Phone 7 is a different platform. It really begins with something called Smart Design. This is an important concept for Windows Phone 7, evolving around the Metro design language. Metro really defines the User Interface of phone. As an application or game developer you need to understand the Metro concept to assure that your applications create consistent experiences for end users.A big part of Windows Phone 7 is the idea of Integrated Experiences, bundling together things like:Xbox Live and Xbox gamingFull Microsoft Office integrationFull Zune experience on the phone
40 Years of Swiss and Swiss Influence DesignPrintPackageAligned with design direction for Metro UI
Integrated Experiences:The market for Windows Phone 7 consists of consumers with both a personal life and a business lifeThe phone works great in the customer’s personal life as well as in their business lifeIntegrated Office functionality creates great experiences for business usePictures and Multimedia experiences are great for personal useGetting applications on the phone for end users is easy through MarketplaceDelivering applications to Marketplace is easy for Developers
Same as the previous slide, but with more detailed components displayed. Just use this as another overview. On the next slides a number of individual items will be explained in more details.
Flash is frame based – Silverlight is time based. Also talk about Render thread and double animation storyboards running on GPU.
As you saw in the demo, the TextBox really integrates with the Operating System software keyboardThere is also a password obfuscation delay. When you enter data on a password textbox, you can see the entered character for a second before it turns into a dot. This is what you expect on a phone because entering passwords is kind of tricky when you are using the software keyboard.You also saw that built-in controls have gesture support. There are also new events available on controls that are called “Manipulation Events”. They are fired when manipulations are started and ended or when a particular delta is reached. Using these events on controls you are able to influence gestures.
We start discussing the integration that applications have with the software keyboard and something called the ‘input scope’.The input scope is a hint to the software keyboard about how you want the keyboard to be shown to the user (when for instance entering text in a textbox). Can be specific for:Phone numberWeb addressEmail addressGeneric textSee separate demo script for a full explanation (Demo 2).
The accelerometer is pretty much straight forward. You get force in units of gravity applied in every dimension over time. Every sample comes with an x, y and z force and a time stamp.If the device is just laying flat on a surface, it has -1 unit of gravity in the Z-direction.X and Y coordinates are similar to screen coordinates, Z gets into the device.When you shake the device, you will get readings containing values larger than 1 unit of gravity.
There are three different ways to retrieve location on the phone:GPSLocation information very accurateRadio drains significant powerInitial reading slow (especially if the device has been moved over a long distance without GPX fixes)Does not work indoorsCell Tower LookupNot that accurate (depends on the distance between cell towers)No additional power requirements (assuming the phone radio is switched on already)Fast location retrieval (if the phone radio is switched on, you are already connected to tower(s))No 100% coverageWiFi LookupIn between GPS and Cell Tower in both accuracy, speed and battery consumptionWorks pretty good in larger citiesIndependent of physical location retrieval, one consistent API is used inside your application.The cloud can help getting more accurate location readings, based on other people having been at the same location (without the need for enabling GPS on a particular, individual device)Location services do not only retrieve Lat/Long readings, but can also resolve address information through reverse geocoding services.
Location services are currently not supported on the emulator (there is not something like FakeGPS), but you can use a mock to ‘pretend receiving’ location dataLocation services combine smart software on the device with a backend service to balance accuracy of location with time / power it takes to get the locationFor some applications location down to city or zip code level is sufficientOther applications need read accurate location information up to a few yardsThe different location requirements can be specified, using a location API that is not only available on the phone, but also on the desktop (Windows 7, .NET Framework 4.0)Reactive Extensions, http://msdn.microsoft.com/en-us/library/ff431792(v=VS.92).aspx
See separate demo script for a full explanation (Demo 5).
This is just a list of all launchers and choosers that are available on Windows Phone 7.Again: A launcher starts an existing Operating System application and puts your application (temporarily) to the background.A chooser is a piece of Operating System functionality that can select some stored data and return it to your application.
Why there is no exit buttonhttp://blogs.msdn.com/b/ptorr/archive/2010/08/01/exiting-a-windows-phone-application.aspxDon’t forget to mention PopUp Control.
Unique to a Silverlight application on the phone is that a lot of things can happen while the user is working with your application.Phone calls will come in and text messages and the lock screen might be active if the user stops working with your application.All of this activity effects the way your application runs on the device.
The application life time on a phone is basically similar to any other application. An application that is not running can be started, therefore becomes running and after some time it might be terminated, reentering the not running state.A phone application differs slightly from a ‘normal’ application. [Animate]While you are running on the phone two things can happen, each with their own behavior that we will cover in detail: The application can be obscuredThe application can be paused
The behavior of an obscured application is not implemented in the MIX CTP, so we can’t show this on the device emulator. Each numbered item explains the situation after an animation:An application is runningSomething happens on the device (e.g. A phone call, a low battery warning, a calendar reminder)This means that the user cannot see your application anymoreIn this situation the OS tells you that it has been obscuredGives the app the opportunity to do somethingThe application keeps runningNo resources are being taken from the applicationAfter some time the event that happened on the device goes away (e.g. the user confirmed a dialog), resulting in an unobscured notification to your appThe application knows it is entirely visible againFor instance, if the application is a game, it can pause itself when it is obscured. However, anything that does not require user interaction can simply continue.Then when the application (game) becomes unobscured again, you could resume it.
The next thing to investigate is what happens if your application is running and the user jumps to another application.Begin again with the situation where the application is runningThe user does something, for instance click the start button to run another applicationIn this situation, the application will receive a pause event, indicating that the application should stop doing what it is doing. The OS actually suspends the application in this case.If the user comes back to your application it will receive a resume event and can continue runningImportant: While you are suspended you should assume that your process is killed!! (it might not really happen, depending on resources used by your application and the resources needed by the application that is now running)When you enter the pause state, your application should save its state for future useThe paging model of an application can help here, if all your pages are stateless you don’t have to do anything in particularWhen the resume event happens, just go back to that state (could be a page) where you were when you were pausedThis approach guarantees that the user does not even know that your application was suspended and possibly killed
Push notifications are a way to offload background processing from the device into the cloudNo need to use the battery, CPU cycles and memory on the deviceInitiated by the server to enable key background scenariosAKA ‘Smart Multitasking’Users can focus on the foreground application that has as much resources as possible availableYou (as a developer) can notify the user through the server if there is something they should know about or react upon
There are three types of push notifications that you can use on a Windows PhoneNotifications that show up when your application is not running:Tile UpdateToast NotificationNotification that show up when your application is running:Possibility to immediately update your UITile UpdateImagine an application that gets photo feeds, for instance from a service like flickr. Currently the tile shows there are 14 pictures available[Animate]Something happens on the backend: new pictures become available. Through push notifications the tile can be updated[Animate]Toast NotificationImagine a weather application. The user has indicated that they want to be informed about weather updates. Currently the user is not using the weather application though.[Animate]You can send a toast to the device. It appears on the screen, regardless of what the user is doing on the device. If the user clicks on the toast, your application will be launched.[Animate]Push Notification while your application is runningInstead of polling for changes, you setup a push notification (meaning your application will wait for something to happen on the backend with no polling necessary). When something happens on the backend, the server will ping your application.[Animate]The application can take immediate action, for instance to display a newly received message to the user.
Explain in a bit of detail how push notifications work (numbers correspond to next animation)Start with your application running on the deviceThe user indicates that they are interested in some notifications that your application can receiveYou are opening a push channel inside your application with the push clientThe push client returns a unique (per device and per application) URI to your applicationThe URI points to some live service hosted by Microsoft, somewhere in the cloudYour application sends that unique URI to your own back end serviceCan use any mechanismCan use any type of authenticationCan use custom protocolsYour service just sits somewhere in the cloud, waiting for something to happenIf something interesting happens ….Your service takes the event data and posts it to the unique URINo magic, just an ordinary http POSTThe Push Service takes the data you gave it and uses the URL to identify the device and the applicationThe data is send to the deviceDepending on the state of the device and the type of notification, the notification willAppear in the application (where you are responsible to display it to the user)Show up as a toast notification (the operating system takes care of this)Update a tile (the operating system takes care of this)
Right now, you are going to show some code, because the whole mechanism of push notifications is much simpler than it actually sounds.See separate demo script for a full explanation (Demo 4).
Develop your applicationDebug your applicationBeta program support to allow customers to help testing your applicationSubmit your applicationApplication will be certifiedFriction freeGuarantees good end user experienceProcess will be very transparentYou know what happens during certificationApplication will be available in the market place
Marketplace is an integrated experience on the phoneUsed to acquire contentMusicVideosGamesApplicationsAllows friends to recommend stuff to youFun to useMeans it will be used a lotTry vs Buy (distinguish with one single API: boolIsTrial())Additional API that can take end users that run your app in trial mode immediately to the location on Marketplace where they can buy your applicationBilling flexibility (focus on the end user)End users like billing through Mobile Operators over credit card billingManaged by MicrosoftApplications will be updated through Marketplace as well.