cool stuff your app can do

37
Cool Stuff Your App Can Do Ed Donahue Academic Developer Evangelist [email protected] creepyed.com | @creepyed

Upload: ed-donahue

Post on 18-Jan-2015

1.621 views

Category:

Technology


1 download

DESCRIPTION

To get a .zip file of the demos, email me!

TRANSCRIPT

Page 1: Cool Stuff Your App Can Do

Cool Stuff Your App Can Do

Ed DonahueAcademic Developer Evangelist

[email protected] | @creepyed

Page 2: Cool Stuff Your App Can Do

Windows Phone

What I’m Going to Cover

Storage and tombstoningAlarms and remindersApplication tilesOther cool stuff

2

Page 3: Cool Stuff Your App Can Do

Storage and Tombstoning

Page 4: Cool Stuff Your App Can Do

Demo

Fast Application Switching

Page 5: Cool Stuff Your App Can Do

Windows Phone

Application Lifecycle - Dormant

running

deactivated

dormant

activated

Phone resources detachedThreads & timers suspended

Fast App Resume

Save State!State preserved!e.IsApplicationInstancePreserved== true

Page 6: Cool Stuff Your App Can Do

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

Page 7: Cool Stuff Your App Can Do

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 }}

Page 8: Cool Stuff Your App Can Do

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

Page 9: Cool Stuff Your App Can Do

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 -

Page 10: Cool Stuff Your App Can Do

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

Page 11: Cool Stuff Your App Can Do

Demo

• With No Storage• With Storage• Fully Working

Captain’s Log

Page 12: Cool Stuff Your App Can Do

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

Page 13: Cool Stuff Your App Can Do

Alarms and Reminders

Page 14: Cool Stuff Your App Can Do

Windows Phone

Scheduled Notifications

Time-based, on-phone notifications

Supports Alarms & RemindersPersist across rebootsAdheres to user settingsConsistent with phone UX

Page 15: Cool Stuff Your App Can Do

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

Page 16: Cool Stuff Your App Can Do

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);

Page 17: Cool Stuff Your App Can Do

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");}

Page 18: Cool Stuff Your App Can Do

Demo

Egg Timer

Page 19: Cool Stuff Your App Can Do

Application Tiles

Page 20: Cool Stuff Your App Can Do

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

Page 21: Cool Stuff Your App Can Do

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

Page 22: Cool Stuff Your App Can Do

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!

Page 23: Cool Stuff Your App Can Do

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

Page 24: Cool Stuff Your App Can Do

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

Page 25: Cool Stuff Your App Can Do

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

Page 26: Cool Stuff Your App Can Do

Demo

Live Tiles – Local Tile API

Page 27: Cool Stuff Your App Can Do

Other Cool Stuff

Page 28: Cool Stuff Your App Can Do

Windows Phone

Easy-Bake Oven Apps

AppMakrFollow My FeedScriptTDSilverlight Toolkit: silverlight.codeplex.com

Page 29: Cool Stuff Your App Can Do

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

Page 30: Cool Stuff Your App Can Do

Windows Phone

FollowMyFeed.net

Uses PanoramaOne RSS feedAllows for favorites

Page 31: Cool Stuff Your App Can Do

Windows Phone

ScriptTD

Tower defense game engineAll you have to do is change the graphics & audio!

scriptTD.codeplex.com/

Page 32: Cool Stuff Your App Can Do

Contests!

Page 33: Cool Stuff Your App Can Do

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

Page 34: Cool Stuff Your App Can Do

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

Page 35: Cool Stuff Your App Can Do

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

Page 36: Cool Stuff Your App Can Do

Q&A

Page 37: Cool Stuff Your App Can Do

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.