Windows Phone 7.5 Mango - What's New
-
Upload
sascha-corti -
Category
Technology
-
view
3.135 -
download
8
description
Transcript of Windows Phone 7.5 Mango - What's New
Sascha P. CortiDeveloper Evangelist, Microsoft [email protected] | blog | twitter
Windows Phone 7 MangoOverview for Developers
insideMango
Windows Phone 7 “Mango”
Windows Phone
Software Architecture
App Model
Cloud and Integration
Services
Hardware Foundation
UI Model
Gyro
Camera, Sensors & Motion
Fast App Switch
Silverlight and XNA
Integration
Silverlight 4.0
Flexible chassis
SQL CEGen GC
Push, Alerts
Multitasking
Calendar Contacts
Maps
Extras, Tiles
“Mango”
Sockets
Multi-Tasking
Software Architecture
App Model
Cloud and Integration
Services
Hardware Foundation
UI Model
MultiTasking
Start in ForegroundContinue in Background
Multitasking
current
WordsByPaul van Dyk
0:09
fav
0:100:110:129:00 AMFridayOctober 21TechDays 2011 FallBern9:00 AM – 6:00 PM
Background Notification Service
Alarms
ModalSnooze and DismissSound CustomizationNo App InvocationNo Stacking
using Microsoft.Phone.Scheduler;
private void AddAlarm(object sender, RoutedEventArgs e){ Alarm alarm = new Alarm("Long Day"); alarm.BeginTime = DateTime.Now.AddSeconds(15); alarm.Content = "It's been a long day. Go to bed."; alarm.Title = "Alarm";
ScheduledActionService.Add(alarm);}
Background Notification Service
using Microsoft.Phone.Scheduler;
private void AddReminder(object sender, RoutedEventArgs e){ Reminder reminder = new Reminder("CompanyMeeting"); reminder.BeginTime = DateTime.Now.AddSeconds(15); reminder.Content = "Soccer Fields by The Commons"; reminder.Title = "Microsoft Annual Company Product Fair 2009"; reminder.RecurrenceType = RecurrenceInterval.Yearly; reminder.NavigationUri = new Uri("/Reminder.xaml", UriKind.Relative);
ScheduledActionService.Add(reminder);}
Reminders
Persisted Across RebootsRich InformationIntegrates with other RemindersSnooze and DismissLaunch AppFollows Phone Global Settings
Background Transfer Service
download
My WP Book App
Ready Player One
Jpod
WP7 for Devs
Great Mysteries o
CloudBackground
Transfer Service < 100
MB
<20 MB
<~3.0 MB
GET
POST
void DownloadWithBTS(Uri sourceUri, Uri destinationPath){ btr = new BackgroundTransferRequest(sourceUri, destinationUri); btr.TransferStatusChanged += BtsStatusChanged; btr.TransferProgressChanged += BtsProgressChanged; BackgroundTransferService.Add(btr);}
void BtsProgressChanged(object sender, BackgroundTransferEventArgs e){
DrawProgressBar(e.Request.BytesReceived);
}
using Microsoft.Phone.BackgroundTransfer;
void GetCurrentProgress(){ DrawProgressBar(btr.BytesReceived);}
completed
My WPBook App
ISO Store
Background Transfer Service
demo…
AgentsPeriodicOn IdleMay have One or Both
Initialized in Foreground, Run in BackgroundPersisted across Reboots
User control through Control PanelUp to a Maximum of 18 periodic agents
Synchronize with Foreground through MutexAgent runs for up to 14 Days (can be renewed)
Generic Background Agents Occurrence: Every 30 min
Duration: 15 secondsScenarios: Incremental Data Sync
Occurrence: External power, non-cell networkDuration: 10 minutesScenarios: Data Feasting
Background Agents
demo…
Application Lifecycle
Software Architecture
App Model
Cloud and Integration
Services
Hardware Foundation
UI Model
Fast App Switchin
g
Faster user experience!Enabled for all Mango appsRecompile & Test your WP7 application
New Application Resume UX
Resuming . . .
WindowsPhone 7
WindowsPhone 7.5Mango
TapTap and
hold
running
deactivated
dormant
activated
Application Lifecycle
Phone resources detachedThreads & timers suspended
Fast App Resume
Save App
State!
State isPreserved
Tombstoned
Application
_Deactivated
10Tomb
stoned
Application
_Activated
Tombstoned
Application
_Launching
Resuming . . .
running
deactivated
dormant
activated
Application Lifecycle
Tombstone the
oldest app
tombstoned
Restore App State
RestoreState !
Tombstoned
Application
_Activated
running
deactivated
dormant
activated
Application Lifecycle
tombstoned
Tombstoned
Application
_Closing10
Multitasking Cheat SheetJob Tool
Resume quickly from the lock screen
Fast App Switching
Set an alarm or reminder at a precise time
Background Notification
Upload or download files Background Transfer
Event-based toast/tile updates Push Notifications
Location-based services; regular toast/tile updates; data pre-caching; etc.
Periodic Background Agent
Play music in the background Background Audio Player
Synchronize data; SETI@home; etc.
Resource-Intensive Agent
Real-time GPS tracking Run under the lock screen
New Sensor Capabilites
Software Architecture
App Model
Cloud and Integration
Services
Hardware Foundation
UI Model
Camera“Motion
”Compas
sGyro
New Scenarios EnabledSudoku
Puzzle Solver
Barcode
Scanner
Custom
Camera
3D Virtual World
AR Overla
ys
Hardware Sensors & API
Accelerometer
CompassNot Mandatory in HW(but present if Gyro is)
GyroNot Mandatory in HW
MotionSensorAll the Sensor + MathUse whenever availableAlso works w/o Gyro
IndividualAPIs availablefor all Sensors
NEW
NEW
Motion Sensor
[cos γ .cos α −cos β . sin α+sin β . sin γ .cosα sin β . sin α+cos β .sin γ .co
s α
cos γ . sin α cos β .cos α+sin β . sin γ . sinα − sin β .cos α+cos β . sin γ .sin α
− sin γ sin β .cosγcos β .sin γ
]
HARDWARE APIs
Motion & Accelerometer
demo…
Local Database
Software Architecture
App Model
Cloud and Integration
Services
Hardware Foundation
UI Model
SQL CE
Local Data Storage: Overview
Apps store private data in Isolated Storage
Settings and properties in the app dictionaryUnstructured data in Isolated Storage files Structured data in database files
Application
Settings File
AppCreates/Managesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manage
r
App Root Folder
WP7 Isolated Storage
APIs
Install
DB
Database file
DB DatabaseFile (r/o)
“Mango” Updated Developer Tools
Emulator & Developer ToolsEmulator Enhancements
Memory model improvements
Emulator can handle physical memory fragmentations
Media support for H.264, AACSensor Support
Accelerometer and Location
Multi-Touch
Tools EnhancementsIntegrated Profiler
Visual , Code and Memory profiler
Performance AnalysisBuilt-in anti-pattern analyzerGuides through step-by-step
Background Agent Debugging
Marketplace Test Kit
Developer ToolsSimulating GPS Data & SensorsProfilingMarketplace Test Kit
demo…
Live Tile Improvements
Software Architecture
App Model
Cloud and Integration
Services
Hardware Foundation
UI Model
Live Tiles
Local Tile APIsFull Control of ALL Properties
Multiple Tiles per appCreate, Update / Delete / QueryLaunches directly to In App URI
Live Tile Improvements
Application TileLaunches main app experience
Secondary TileLaunches world news page
Secondary TileLaunches local news page
Back of Tile UpdatesFull Control of all Properties when your App is in Foreground or BackgroundContent, Title, Background
Flips from Front to Back at random IntervalSmart Logic make Flips Asynchronous
Live Tiles – Local Tile API
Title
Content
Title
BackgroundContent string is bigger
The New Market Place
Fresh
Mango
Apps
What’s New on the Marketplace?Deep Link
http://windowsphone.com/s?appid=8bda38b9-619e-4368-b849-d25630266c4b
ITIN
Resubmit Apps to Reach New Markets!
Marketplace: Distribution Options
* People who obtain deeplink can access
“Beta” Private Public# of users 100 unlimited unlimited
App Price Must be “free” Can be “paid” Can be “paid”
Time Limited Expires after 90d
No No
Updateable No Yes Yes
Certification Required
No Yes Yes
Discoverable No No * Yes
Access Control
Limited to test user WLIDs provided
No No
Target Users Beta Users Private Users Public Users
Marketplace: New Regions1.8 Billion More Potential UsersResubmit your App to reach New Markets!
Hong Kong
Singapore
Today (16)
+19 New (35)
Resources
Online Resources I : The BasicsApp Hub http://create.msdn.com
Tools http://wpdev.ms/wpsdk71rc
WP on MSDN Library http://wpdev.ms/wponmsdn
WP “How To” Index http://wpdev.ms/wphowtos
WP UX Guide http://wpdev.ms/wpuxguide
WP P&P Guide http://wpdev.ms/wppnpguide
WP Dev Blog http://wpdev.ms/developerblog
Porting to WP http://wpdev.ms/porting
WP Labs (RTM) http://wpdev.ms/wprtmhols
WP Labs (Mango) http://wpdev.ms/mangohol
WP SL Quick Starts http://wpdev.ms/xamlquick
Online Resources II : VideosWP Jumpstart http://wpdev.ms/jumpstarts
WP How To Videos http://wpdev.ms/howvidsWP “Absolute Beginners”
http://wpdev.ms/beginvids
Inside WP on C9 http://wpdev.ms/insidewpDesign Toolbox http://wpdev.ms/designtbWP Game Dev Vids http://wpdev.ms/gamevidsWP at MIX 11 Vids http://wpdev.ms/wpmix11WP at TENA 11 Vids http://wpdev.ms/wptena11
Online Resources III : OtherApp Hub FAQ http://wpdev.ms/apphubfaq
App Hub Forums http://wpdev.ms/ahforumRegistration Walkthrough
http://wpdev.ms/regwalk
Submission Walkthrough
http://wpdev.ms/subwalk
Cert Requirements http://wpdev.ms/certreqWP Samples on MSDN
http://wpdev.ms/officialsamples
SL Toolkit for WP http://wpdev.ms/wpsltkAzure Toolkit for WP http://wpdev.ms/wpwaztk
Online Resources IV : 3rd PartySilverlight Show on WP
http://www.silverlightshow.net/Search.aspx?q=%5Bwindows-phone-7%5D
Windows Phone Geek
http://www.windowsphonegeek.com/
WPDEV on Twitter http://twitter.com/#search?q=wp7devWPDEV on REDDIT http://www.reddit.com/r/wp7dev
WPDEV on Stack Overflow
http://stackoverflow.com/questions/tagged/windows-phone-7
© 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.
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.
Backup Slides
Demo Title
demo…
Windows Phone 7 “Mango”Overview
Multi-taskingEnhanced Phone FrameworkXNA Silverlight IntegrationIntegrating with the phonePerformance Database AccessComplete the push notification and Tile experienceMarketplace ServicesSockets
Major Investment Areas
Fast Application ResumeAbility to resume applications that the user has recently usedApps stay in memory unless memory is needed for other apps*Every* app should do this
Background AgentsAbility to run your code in the backgroundAudio, Timed or on Idle
NotificationsAbility to create alarms and remindersUX and behavior is the same as the phone Alarms and Calendar items
Background Transfer ServiceApplication can queue up transfers in the background
Multitasking Themes
Integrating with the Phone
51
Camera
Access to the pipeline
No need to capture the image to flash
Networking
Sockets
Connection Manager control
Sensors
GPS
Accelerometer
Compass
Gyro
Spatial Framework
Data
SQL CE
Phone Contacts
Phone Calendar
Launchers & Choosers
Bing Maps
Phone Number
Address Chooser
Controls
Frame and Page Navigation improvements
Performance
Open Source on CodePlex
Expanding the Phone Framework
52
Push Notifications
Deep Toast
More control over notifications
Phone Extras
Search
Music
Photos
Tiles
Signature user experience for Windows Phone
Complete Framework
Multiple Tiles
Silverlight Investments
53
Silverlight 4
RichTextBox
Implicit Styles
Clipboard API
Performance
Memory Management
Input on Render Thread
Profiler Instrumentation
International
Reading/Writing of all Mango Languages
Big deal if you are writing an app for Asia
Tools Investments
.NET
Performance
Generational GC
Serialization
SIMD – Vector
Profiler
Tools
New Template for Multitasking
Debugging Background Agents
Isolated Storage Explorer
Profiler
Emulator
Sensors and Location in Emulator
Multi Touch in Emulator
Screen shot
Ingestion Tool
Platform Architecture
Hardware Foundation
Software ArchitectureApplications
App ModelApp managementLicensingChamber isolationSoftware updatesData sharing
UI ModelShell frame Session managerDirect3DCompositor
Kernel
SecurityNetworkingStorage
Cloud IntegrationXbox LIVEBingLocationPush notificationsWindows Live ID
Your App UI and logic
Hardware BSP
A-GPS Accelerometer Gyro Compass Light Proximity
Media Wi-Fi Radio Graphics
Frameworks
HTML5/JavaScript
CLR
Silverlight and XNA
Structured dataUser data
Frameworks Details
Common Base Class Library
Collections ComponentModel Configuration
Diagnostics
Reflection IO
Security Threading
RuntimeResource
sGlobalization TextLocation Net
ServiceModel Linq
Application Object
Silverlight Presentation and Media XNA Frameworks for Games
Windows Phone Frameworks
NavigationShapes Markup Media
Controls DrawingIsolatedStorag
e
AudioMedia GraphicsInput
DrawingGamerService
s
Content
PhoneApplicationPage
PushNotification
WebBrowserControl
SensorsPhoneApplicationFra
me
CameraDevice
IntegrationLaunchers &
ChoosersWindows Phone
ControlsMultiTasking
Structured Data
Silverlight4.0
Silverlight Integration
Sockets
New Sensor Capabilites
Sensors: Good to KnowNeed hardware to debug most scenarios
Camera, motion, compass, & gyro require hardwareFor accelerometer, you can use the emulator!
Motion sensor will try it’s bestWorks best with all three sensorsWill also work if only compass and accelerometer are present
Camera Output for video recorded is MP4Always check for device specific support for Flash modeUse Y or YUV format for processing samples – faster than ARGB
Local Database
LINQ to Everything
LINQ
Objects XML SQLUser Data
WP7
Mango
OData
Database Creation: Example// Define the data context.public partial class WineDataContext : DataContext {
public Table<Wine> Wines;public Table<Vineyard> Vineyards;public WineDataContext(string connection) : base(connection) { }
}
// Define the tables in the database[Table]public class Wine{
[Column(IsPrimaryKey=true]public string WineID { get; set; }[Column]public string Name { get; set; }……
}
// Create the database form data context, using a connection stringDataContext db = new WineDataContext("isostore:/wineDB.sdf");if (!db.DatabaseExists()) db.CreateDatabase();
Application Lifecycle
Methods &Events
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
Activation Resource Management
MediaElement.Source/Position/PlaySocket.ConnectAsync
new 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 -
Multi-Tasking
Software Architecture
App Model
Cloud and Integration
Services
Hardware Foundation
UI Model
MultiTasking
Background Audio – HTML5
CloudBrowser
www.html5audio.
<audio id="audio_tag" controls="controls" src="http://html5audio.com/Demo1.mp3" onplay="StartPlayback()" onended="NextTrack()"</audio>
Zune Service
function NextTrack() { musicPlayer = document.getElementById("audio_tag"); musicPlayer.src = 'http://html5audio.com/Demo2.mp3'; }
++
9:00 AMFridayOctober 21TechDays 2011 FallBern9:00 AM – 6:00 PM
Background Audio – URL Based
current
Words Paul van Dyk
0:09
fav
0:100:110:12
Player = BackgroundAudioPlayer.Instance;player.PlayStateChanged += new eventHandler(PlayStateChanged);
AudioTrack track = new AudioTrack(new Uri("/audiofile.mp3"),…);
void PlayStateChanged(object sender, EventArgs e){ switch (player.PlayerState) { case PlayState.FastForwarding: // Move to next track break; }}
CloudZune Service
My MusicApp
ISO Store
player.Play();
++
++
Buffer
Buffer
Background Audio – Streaming
9:00 AMFridayOctober 21TechDays 2011 FallBern9:00 AM – 6:00 PM
End-To-End Architecture
System Services
ISO StoreCloud
DifferentProcesses
Logic
UX
myapp.dll
Application OS
Logic
myappagent.dll
Single App
Developer
Periodic Agent Sample
<Tasks> <DefaultTask Name ="_default" NavigationPage="MainPage.xaml"/> <ExtendedTask Name="BgTask"> <BackgroundServiceAgent Speer="ScheduledTaskAgent" Name="TwitterAgent" Source="TweetAgent" Type="TweetAgent.TweetAgent"/> </ExtendedTask> </Tasks>
public class TweetAgent : ScheduledTaskAgent{ public override void OnInvoke(ScheduledTask Task) { // Do some background work
NotifyComplete(); };}
private void StartSearchAgent(object sender, RoutedEventArgs e){ PeriodicTask task = new PeriodicTask("twitter"); task.Description = "Gets latest tweet"; task.ExpirationTime = DateTime.Now.AddDays(7); ScheduledActionService.Add(task);}
Contacts & Calendar
Chooser Tasks related to user dataEmailAddressChooserTaskPhoneNumberChooserTaskAddressChooserTask
Microsoft.Phone.UserData for direct accessContactsAppointments
New and updated APIs in “Mango”
Contacts: Hello, World!Contacts contacts = new Contacts();
contacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>((sender, e) => { ... = e.Results; });
// E.g. search for all contactscontacts.SearchAsync(string.Empty, FilterKind.None, null);
filter expression(not a regex)
Filter kind: name, email , phone or pinned to start)
state
// E.g. search for all contacts with display name matching "Sa"contacts.SearchAsync("Sa", FilterKind.DisplayName, null);
Appointments: Hello, World!Appointments appointments = new Appointments();
appointments.SearchCompleted += new EventHandler<AppointmentsSearchEventArgs>((sender, e) => { ... = e.Results; });
// E.g. get next appointment (up to 1 week away)appointments.SearchAsync(DateTime.Now, DateTime.Now + TimeSpan.FromDays(7), 1, null);
start date and time
Maximum items to return
stateend date and time
Be responsibleYour privacy policy should cover how you use the user’s contact information
Keep out of the wayUsers have widely varying contact list sizes Your UI should handle delays gracefully
Don’t let data get staleData returned is a snapshotRefresh state when reasonable
Performance and Best Practices
New Choosers and Launchers
NewSaveRingtoneTaskAddressChooseTaskBingMapsTaskBingMapsDirectionsTaskGameInviteTask
Updates:EmailAddressChooserTask PhoneNumberChooserTask
AddressChooserTaskprivate AddressChooserTask addressChooserTask;
// Constructorpublic MainPage(){ this.addressChooserTask = new AddressChooserTask(); this.addressChooserTask.Completed += new
EventHandler<AddressResult>( addressChooserTask_Completed);
}
private void addressChooserTask_Completed(object sender, AddressResult e){ if (null == e.Error && TaskResult.OK == e.TaskResult) {
... = e.DisplayName;
... = e.Address; }}
Microsoft.Phone.UserData
Important pointsContacts and Appointments APIs are read onlyThird party social network data cannot be shared
Contacts/Appointments Data Shared Contact
Nameand Picture
Other Contact Data
Appointments/ Events
Windows Live Social YES YES YES
Windows Live Rolodex(user created and SIM import)
YES YES n/a
Exchange accounts(corporate plus Google, etc.)
YES YES YES
Operator Address Books
YES YES n/a
Facebook YES NO NO
Other networks in the People Hub (e.g., Twitter)
NO NO NO
The New Market Place
MarketPlace: ImprovementsChallenges Fixed
Support Responsiveness. 98% of support inquiries are now responded to within 24 hours
Free app submission limits. Increased limit from 5 to 100 per year
Market-specific registration challenges. Fixed registration form and postal code validation logic
Registration problems due to Xbox profile. Fixed the linking of developer profile information between App hub and xbox.com
Blank or incomplete test results. Now providing complete certification failure report
Challenges Remaining
App certification consistency and test results feedback.
ID validation process is cumbersome. Revamping individual validation process
W-8 form requirement (for non-US developers). Working to simplify and automate
Submission process has errors. Working to eliminate bottlenecks and streamline process
Registration payment failures for some. Fixing remaining payment exception scenarios.
Distribute pre-certified Apps to a Set of Beta UsersCapabilities
Developer selects List of Testers (up to 100)Developer sends Email with Private Deeplink to the Testers Only Testers selected in App Hub can test the Application and provide Feedback for 90 daysBeta cannot be updated
BenefitsNo need to unlock Phones to test Apps
New Beta Distribution Service