Today I went to the WP7 boot camp in Minneapolis. Not many people have actually seen a Windows Phone 7 yet. I was hoping to see the real thing but it wasn’t available. Although, the dev tools are ready and very robust.
Getting started is easy using the developer tools and developer training kit. After downloading and playing around I really hope WP7 is a success. The development experience is slick if you are willing to embrace XAML or XNA.
A note about the install. If you have a full version of Visual Studio it will integrate with that. Otherwise it will install Visual Studio express. A few people in the group were confused when they opened express and the tools were not available as they already had VS2010 installed. (Note, it might be safer to use VS Express for now with this beta if you can. The presenter was having issues adding service references with VS Pro but it works in express.)Since the first part of the conversation was about marketing information I ported over a Silverlight 3 test application which uses data binding and notifications to draw lines onto a canvas. All I had to do was copy the code verbatim and it ran on the phone. It took me 5 minutes. The ease of portability was impressive. Although, Silverlight is at a 60 – 65% adoption rate so portability is relative depending on market conditions.
Below are a list of notes that caught my attention during the talk. This is all based on a beta product so some of this may change. For the latest information download the WP7 Training Kit and visit the wp7 developer site.
- $100 fee to upload apps to market place. You get paid after you make the first $100 but Microsoft will take a cut for each sale.
- Has ability to upload app in trial mode
- Silverlight capabilities is basically Silverlight 3 plus additional features.
Known Issues with Emulator:
- Sometimes Emulator will not change from portrait to landscape if keyboard is enabled to be used. Hit PageDown to disable it
- When using VS Pro some users have not been able to add service references correctly. They didn’t generate the full proxy.
Tips and Tricks:
- Use PageUp and PageDown keys to enable keyboard in emulator.
- Emulator can be kept running and will store all opened apps.
- Blend can be used to test light and dark template available to phone users.
- Code from Silverlight 3 should work on the phone with maybe only small tweaks for things like navigation and UI sizes.
- List Application (list and details page paradigm)
- Binding works just like in Silverlight
- DataContext works like Silverlight
- Input scopes “TelephoneAreaCode” and “EmailSMTPAdress” allow you to change keyboard layout. Developer Note: You can use Verbose XAML syntax for intellisense. You can’t create your own input scopes right now. Demo in SDK uses reflection to explore input scopes.
- Accelerometer – can be used with emulator if laptop that has one built one in. Otherwise you can use accelerometer emulator using RX.
- Audio – leverage raw data override BufferReady event at regular intervals save and manipulate audio. About a 10ms delay. All available in SDK.
- Video elements – Media support is on the hardware – video decoding is down on the hardware. Only one media element on the page at the time. No video media brush. DRM
- XNA API can be used to bring in sounds and background sounds.
3rd Party Tools and Links
- MVVM light for wp7. Design Pattern.
- Developer Note: Bing Maps Control not yet available but being developed.
- All elements can be animated
- Elements can be projected onto 3d plane
- Templating – taking a control and laying a XAML rendering over the code base. Microsoft encourages using the metro theme but they did show a puzzle application that used templating to change buttons and panels.
- Styling can be set in the Application XAML resources or page resources.
- Two screen resolutions will be available.
- User can change the Theme
- Blend can be used to test dark and light themes available to users. Would only need to be done if you go off and build your own template. But if you use the metro theme you get the changes for free. For example, your applications buttons and backgrounds would be updated.
- App bar should be used to create consistent navigation and controls. How to: Add an Application Bar to Your Application on MSDN.
- App bar Icon set can be downloaded here.
- Host (TaskHost)
- XAP file
- Pages (Silverlight)
- Content (Silverlight)
- Games (XNA)
- Apps are built like web sites
- Functionality is split into pages
- Forward navigation via links
- Backward navigation via Back (should use hardware button).
- Users can navigate across different applications
- Previous app (pages) are in the back stack. No multi tasking for third party apps. The back stack means your app is shut down.
- Back (only one you can inject into when it fires right now)
Feels like web design.
- Application state can be passed between pages by querystring and frame context.
- hyperlinks can be used to navigate to other pages.
- UriMapping which is similar to MVC URL routing.
Push Notification Service via the cloud (Microsoft Notification service)
- Developer Note: When the emulator starts it takes 30 seconds to instantiate notification service.
- Phones subscribe to a service on your server for events via a Uri.
- All communication pushed to phone is via Microsoft.
- Events are sent from a server to Microsoft push service.
- Developer Note: No Emulator Support – MSDN RX emulator can be created.
- Cell Tower, Satellite GPS, or WIFI can be used
- Developer Note: Use cell tower to save battery but less accurate
Types of Notifications on the Phone
- Tile Notifications – Tile on homepage which has an image, number, and simple text.
- Toast – pop-up will link back to app.
- If the app is running raw data can be accessed and displayed.
Handling Life Time Events: Obscure VS Deactivated
Hidden By Shell UI: Obscured
- On Obscure you need to handle it gracefully then when un obscure you need to start.
Moved to background: Deactivated
- Deactivate event fires
- Your app becomes suspended (you have a limited time to handle but not specified yet)
- State will be destroyed eventually if user doesn’t go back. Assume your app is killed.
- If user goes back to application Activate event will be fired
- You can load state via isolated storage and resume where you left off
Interesting Questions asked during the presentation:
- Question: Are ODBC drivers available or ported? Answer: Someone suggested using isolated storage for this instead.
- Question: Does page Navigation come with default animation? Answer: It doesn’t come with a default animation. But you can add them in by intercepting the navigation event.
- Question: How is back stack clean up done and can it be prioritized? Answer: Presenter guessed that it might be resource based but not sure yet.
- Question: Can you control the Antenna for GPS? Can you turn it off or on and receive notifications when it is ready? Answer: Start and Stop service might be used for this but not sure. It looks like the API only tries to use it if available. Look at Location example in SDK.