Exploring Windows Phone Features Chris Koenig [email protected] 214-385-5616 @chriskoenig | http://chriskoenig.net RELESS: softlayer - techwild
Dec 16, 2014
Exploring Windows Phone FeaturesChris [email protected] @chriskoenig | http://chriskoenig.net
WIRELESS: softlayer - techwild
Windows Phone
30-to-Launch Program OverviewSession 1
• Overview of Windows Phone• Metro Design• Tour: Expression Blend
• Tour: Visual Studio
• Building, Running and Debugging Your First App
• Online Resources
• Signup for Marketplace
Session 2
• Exploring Windows Phone Capabilities• Live Tiles • Sensors & Camera
• Launchers• Choosers• Search Integration
• Advertisements
Session 3
• Working with Data• App Resources• Isolated Storage
• Database• Networking Stack
• Social Integration
Session 4
• Windows Phone Marketplace• Application submittal process
• How to handle rejection
• Promoting your application
• Help submitting your app to the Marketplace
2
Windows Phone
Today’s Agenda
Live Tiles Sensors & Camera Launchers & Choosers Advertisements Push Notifications Background Tasks Search Integration
3
Live Tiles
Windows Phone
Live Tiles Interactive windows
into your application
Personalize them to be meaningful to your users
Built-in support for data for basic communications
Custom image wizardry for more advanced scenarios
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, deep linking MultiTile!
Create/Update/Delete Launches directly to page/experience
Application TileLaunches main app experience
Secondary TileLaunches world news page
Secondary TileLaunches local news page
6
Windows Phone
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
Live Tiles – Local Tile API Continued…
Title
Content
Title
BackgroundContent string is bigger
7
Demo
http://github.com/ChrisKoenig/MangoTiles
Working with Live Tiles
Sensors and Cameras and Launchers and Choosers!
Windows Phone
AccelerometerCompass
Not Mandatory in HW(but present if Gyro is)
GyroNot Mandatory in HW
MotionSensorAll the Sensor + MathUse whenever availableAlso works w/o Gyro
Individual APIs available for all Sensors
HARDWARE APIs
Windows Phone Sensors
10
Windows Phone
Exciting Scenarios EnabledSudok
u Puzzle Solver
Barcode Scanner
CustomCamera
3D Virtual World
AR Overlays
11
Windows Phone
Augmented Reality Scenarios?
GART Toolkit
http://gart.codeplex.com
Written by my teammate!
Demo
Live demo!
Sensors, Camera, Launchers and Choosers
Advertisements
Windows Phone
Advertising SDK
The Advertising SDK is now part of the Windows Phone SDK You can include a Silverlight Ad control in an application or an XNA
Drawable Ad into a game This is very easy to do
15
Windows Phone
Microsoft pubCenter
Sign up here so that you can incorporate ads in your games: http://pubcenter.microsoft.com
Find out more about Windows Phone Advertising: http://advertising.microsoft.com/mobile-apps
16
Demo
Live demo!
Adding the Ad SDK to a Project
Push Notifications
Windows Phone
Push Notifications
Server-initiated communication Enable key background scenarios Preserve battery life and user
experience Prevent polling for updates
19
Windows Phone
Push Notification Data Flow
URI to the service:"http://notify.live.com/throttledthirdparty/
01.00/AAFRQHgiiMWNTYrRDXAHQtz-AgrNpzcDAwAAAAQOMDAwMDAwMDAwMDAwMD
A"
Push enabled applications
Notifications service HTTP POST
the message
Push endpoint is established. URI is created for the endpoint.
1
2
3
3rd party service
Windows Live Push
Notification service
Send PN Message
4
20
Windows Phone21
Three Kinds of Notifications
Raw Notification message content is application-specific Delivered directly to app only if it is running
Toast Specific XML schema Content delivered to app if it is running If app is not running, system displays Toast popup using notification message content
Tile Specific XML schema Never delivered to app If user has pinned app tile to Start screen, system updates it using notification
message content
Windows Phone
Toast Notification
App icon and two text fields
Time critical and personally relevant
Users must opt-in via app UI
22
Demo
http://github.com/ChrisKoenig/PushNotifications
Push Notification Weather Sample
Multitasking
Windows Phone
Multitasking Themes Fast Application Switching
Ability to resume applications that the user has recently used Apps stay in memory unless memory is needed for other apps Use IsApplicationInstancePreserved in App.Activate event to determine
actions Background Agents
Ability to run your code in the background Audio, Timed or on Idle
Notifications Ability to create alarms and reminders UX and behavior is the same as the phone Alarms
and Calendar items Background Transfer Service
Application can queue up transfers in the background25
Windows Phone
Generic Agent TypesPeriodic Agents Occurrence
Every 30 min Duration
15 seconds Scenarios
Incremental data sync Location Others…
On Idle Agents Occurrence
External power, non-cell network
Duration 10 minutes
Scenarios Data feasting Initial sync Others…
26
Windows Phone
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);}
AlarmsRemindersusing 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);}
27
Windows Phone
Background Transfer Service
downloads
My WP Book App
Cheese & WinGreat Mysterie
WP Tips & Tric
CloudBackground
Transfer Service
<2 GB
<20 MB
<~5.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 no limit
28
Windows Phone
Multitasking Cheat Sheet
Job ToolResume quickly from the lock screen Fast App Switching (it’s
free!)Set an alarm or reminder at a precise time
Background Notification
Large file downloads 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
29
Demo
http://github.com/chriskoenig/backgroundagentsample
Background Agents
Search Integration
Demo
http://github.com/ChrisKoenig/AppConnect
Using Search Integration via AppConnect
Windows Phone
NuGet
Package management system for .NET Simplifies incorporating 3rd party libraries Developer focused Free, open source
Install NuGet using the Visual Studio ExtensionManager
Use NuGet to add libraries such as the Silverlight Toolkit to your project
33
Windows Phone
Silverlight Toolkit for Windows Phone A product of the Microsoft Silverlight team The Silverlight Toolkit adds tons of additional controls ‘out of band’
from the official product control set Includes full open source code, samples, documentation, and design-
time support for controls Refresh every 3 months or so
Bug fixes New controls
http://silverlight.codeplex.com Download from NuGet!
34
Windows Phone
Homework
Keep cranking on your project
Ping me for help with roadblocks
Explore more of the training videos and
training kits at http://create.msdn.com
Have fun!35
BeMyAppDallas
Feb 24-26, 2012
register
http://bemyappdallas.eventbrite.com/
AT&T Mobile App Hackathon!Come build your mobile app with us. We will have 5+ senior mobile application developers that will be directly assisting you with your mobile application development efforts. Come to network. Come to learn. Come to hang out!
Where? AT&T Foundry - 2900 West Plano Parkway, Plano, TX 75075
When? Friday Feb 17th at 6PM and all day Saturday!
http://mobileappdfw2.eventbrite.com
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.