cool stuff your app can do
Post on 18-Jan-2015
1.621 Views
Preview:
DESCRIPTION
TRANSCRIPT
Cool Stuff Your App Can Do
Ed DonahueAcademic Developer Evangelist
ed.donahue@microsoft.comcreepyed.com | @creepyed
Windows Phone
What I’m Going to Cover
Storage and tombstoningAlarms and remindersApplication tilesOther cool stuff
2
Storage and Tombstoning
Demo
Fast Application Switching
Windows Phone
Application Lifecycle - Dormant
running
deactivated
dormant
activated
Phone resources detachedThreads & timers suspended
Fast App Resume
Save State!State preserved!e.IsApplicationInstancePreserved== true
Windows Phone
Application Lifecycle - Tombstoned
running
deactivated
dormant Phone resources detachedThreads & timers suspended
Restore state!e.IsApplicationInstancePreserved == false
Resuming .. .
Tombstone the oldest app
Tombstoned
activated
Windows Phone
Finding the Resume type
The Activation handler can test a flag to determine the type of resume taking place
private void Application_Activated(object sender, ActivatedEventArgs e){ if (e.IsApplicationInstancePreserved) { // Dormant - objects in memory intact } else { // Tombstoned - need to reload }}
Windows Phone
Deactivation Resource Management
Deactivated App
PhoneApplicationPage.OnNavigatedFrom
PhoneApplicationService.Deactivated
Framework:Detach Resources
Framework:Suspend Timers and
Threads
Dormant App
MediaPlayer.PauseMediaElement.Pause
SoundEffectInstance.PauseVibrateController.StopPhotoCamera.Dispose
Save page/global state
XNA Audio Paused
Sensors Notifications suppressed
Networking Cancelled
Sockets Disconnected
MediaElement
Disconnected
Camera Disposed
Windows Phone
Activation Resource Management
MediaElement.Source/Position/Play
Socket.ConnectAsyncnew PhotoCamera/VideoCamera
Restore app state if tombstoned
Running App
PhoneApplicationPage.OnNavigatedTo
PhoneApplicationService.Activated
Framework:Attach Resources
Framework:Resume Timers and
Threads
Dormant App
XNA Audio Resumed
Sensors Notifications resumed
Networking Completed with Cancellation
Sockets -
MediaElement
-
Camera -
Windows Phone 10
Isolated Storage vs State Storage Isolated storage is so called because the data for an
application is isolated from all other applications It can be used as filestore where an application can
store folders and files It is slow to access, since it is based on NVRAM
technology It can also be used to store name/value pairs, e.g.
program settings State storage is so called because it is used to hold the
state of an application It can be used to store name/value pairs which are
held in memory for dormant or tombstoned applications
It provides very quick access to data
Demo
• With No Storage• With Storage• Fully Working
Captain’s Log
Windows Phone 12
Fast App Switching and Tombstoning Review Only one Windows Phone application is Active at any
time The Start and Back buttons on the phone are used to
start new applications and return to previously used ones
If an application is replaced by another it is either made Dormant (still in memory but not running) or Tombstoned (removed from memory)
Applications must use populate methods provided in the App.xaml.cs class to save and retrieve state information when appropriate
State can be stored in memory for quick reload and in isolated storage which serve as a permanent store
Alarms and Reminders
Windows Phone
Scheduled Notifications
Time-based, on-phone notifications
Supports Alarms & RemindersPersist across rebootsAdheres to user settingsConsistent with phone UX
Alarms vs Reminders?
Alarms
15
Reminders
•Modal•Snooze and Dismiss•Sound customization•No app invocation•No stacking
• Rich information• Integrates with other
reminders• Snooze and Dismiss• Launch app• Follows the phones global
settings
Windows Phone
Creating a Reminder
This code creates a reminder and adds it as a scheduled service The value eggTime holds the length of the delay This code also sets the url of the page in the application
using Microsoft.Phone.Scheduler;...eggReminder = new Reminder("Egg Timer");
eggReminder.BeginTime = DateTime.Now + new TimeSpan(0, eggTime, 0);eggReminder.Content = "Egg Ready";eggReminder.RecurrenceType = RecurrenceInterval.None;eggReminder.NavigationUri = new Uri("/EggReadyPage.xaml",
UriKind.Relative);
ScheduledActionService.Add(eggReminder);
Windows Phone
Reminder Housekeeping
Reminders are identified by name
This code finds the “Egg Timer” reminder and then removes it from the scheduler
Reminder eggReminder = ScheduledActionService.Find("Egg Timer") as Reminder;
if ( eggReminder != null ) { ScheduledActionService.Remove("Egg Timer");}
Demo
Egg Timer
Application Tiles
Windows Phone
Tiles 101
Shortcuts to apps Static or dynamic 2 sizes: small &
large Large only for
1st party apps End-user is in
control
Windows Phone
Data Driven Template Model A fixed set of data properties Each property corresponds to a UI
element Each UI element has a fixed position on
screen Not all elements need to be used Animations are not extensible
Background Image(173 x
173 .png)
Title Count
Windows Phone
Scenarios/Popular Applications
Send to WP7 Link Tile Link Toast
AlphaJax Turn Tile Move Toast
Seattle Traffic Map Traffic Tile
Weather Apps Weather Tile Warning Toast
Chess by Post Turn Tile Move Toast
Beezz Unread Tile Direct Toast
There are hundreds and hundreds of Push apps in Marketplace!
Windows Phone
Primary and Secondary Tiles
Application Tile Pinned from App List Properties are set initially in
the Application Manifest
Secondary Tile New in Windows Phone 7.5! Created as a result of user
input in an application
Front
Back
Windows Phone
Live Tiles – Local Tile API
Local tile updates (these are *not* push) Full control of all properties when your app
is in the foreground or background Calorie counter, sticky notes
Multi-Tile! Deep-link to specific application sections Launch directly to page/experience
Application TileLaunches main app experience
Secondary TileLaunches world news page
Secondary TileLaunches local news page
Windows Phone
Live Tiles – Local Tile API Continued… Back of tile updates
Full control of all properties when your app is in the foreground or background
Content, Title, Background
Flips from front to back at random interval Smart logic to make flips asynchronous
Title
Content
Title
BackgroundContent string is bigger
Demo
Live Tiles – Local Tile API
Other Cool Stuff
Windows Phone
Easy-Bake Oven Apps
AppMakrFollow My FeedScriptTDSilverlight Toolkit: silverlight.codeplex.com
Windows Phone
AppMakr (appmakr.com) Tips Find RSS feeds either by searching AppMakr or
searching the site for “RSS” Want a Twitter RSS?
http://twitter.com/statuses/user_timeline/USERID.atom
Use www.idfromuser.com to find Twitter user ID Want to make multiple RSS feeds into one?
Yahoo Pipes http://rssmix.com ( I used this one)
Feel free to upload your own images App icon: 512 x 512 pixels Splash screen: 480 x 800 pixels
bit.ly/appmakrlab
Windows Phone
FollowMyFeed.net
Uses PanoramaOne RSS feedAllows for favorites
Windows Phone
ScriptTD
Tower defense game engineAll you have to do is change the graphics & audio!
scriptTD.codeplex.com/
Contests!
Windows Phone
Idea of the Week
Submit your great app idea for a chance to win $50!
Create a Sketchflow prototype and post it online (wp7sketchflow.codeplex.com/)
Tweet the URL with #WPAppItUp
Judged on Innovation, Experience and Potential
Rules: bit.ly/idearules
Windows Phone
Your App Here
Be a featured app in December, January or February!
Win a digital ad campaign that will deliver one million ad impressions!
Receive featured placement on the Windows Phone Marketplace
More info: wpyourapphere.com
Windows Phone
Core77 Fast Track
Design a productivity app for Windows Phone
5 winning designers get an App Development Deal, Windows Phone, Xbox 360 with Kinect, & App Hub subscription
Ends Nov. 18. 2011 More info:
http://fasttrackapp.core77.com
Q&A
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
© 2011 Microsoft Corporation.
All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
top related