developing for windows phone 8.1
DESCRIPTION
Introduction to Windows Phone 8.1 developmentTRANSCRIPT
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Developing for Windows Phone 8.1
Dan ArdeleanMVP Client Development
Nokia Developer [email protected]
@danardelean
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Huge thanks to our sponsors & partners!
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Windows Phone 8.1• Windows Phone 8.1 Developer Platform• New features for developers• Getting Started• Developer Choices
AGENDA
Premium community conference on Microsoft technologies itcampro@ itcamp14#
WINDOWS PHONE 8.1
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Windows Phone 8: Momentum
The Nokia Lumia 920 won Engadget’s Reader’s Choice award for best smartphone of 2012
Microsoft's Windows Phone 8 clearly bests Apple and Android, according to respondents in PC Magazine’s 2013 reader poll
Windows Phone Store was picked by ABI Research as the most innovative mobile app marketplace
Windows Phone 8X and 8S by HTC received the prestigious red dot award: product design 2013
“Windows Phone people like their phones more than Android people” according to ChangeWave Research
Nokia Windows Phones win PCMag’s End-user Business Choice Award 2013
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Start screen: More tiles More personal
Now 3 column start screen available on *all* phones
Customize your Start background with a favourite picture or one of the supplied options
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Cortana: Your PERSONAL Digital Assistant
Interact with CORTANA through speech or type
CORTANA learns about you and your interestsEnables CORTANA to be proactive and helpful throughout the day
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Many New Features for Users Action center to quick launch
settings and view notifications New Skype app integrated with
Phone dialer New Calendar app with new
Week view Fast typing with new Word Flow
keyboard Buy app once: use on PC and on
Phone App data can roam among
devices Start screen backup and restore App data backup Faster app updates Remote viewing of Phone screen Install apps to SD card
Premium community conference on Microsoft technologies itcampro@ itcamp14#
2014: Windows Phone 8.1 Hardware
• Affordability Decrease HW cost floor (support 8x26, Qualcomm Reference Design)
Dual-SIM support
Apps to help you get more out of your data plan: DataSense 2.0, Wi-Fi Sense,
Storage Sense, Battery Sense
8x26
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Getting Windows Phone 8.1
New devices sold into market from May2014 All devices running Windows Phone 8.0 are capable of being upgraded to Windows Phone 8.1Availability of upgrades for contract devices is under the control of the Mobile Operator
Registered developers can upgrade their phone through the ‘Preview for Developers’ programDevelopers who have signed up for a developer account at http://dev.windowsphone.com simply install the Preview for Developers app, then go to Settings > Phone Update > Check for UpdatesIf you’re someone without an ounce of programming skill, you can sign up for Microsoft’s App Studio tool: http://appstudio.windowsphone.com which qualifies you as a registered developer
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Windows Phone 8.1 Preview for Developers
Preview for DevelopersInstalls OS updates on your deviceDoes not install OEM firmware updates
When the ‘proper’ update is released by your MO/OEM, you will get that update as normal
Premium community conference on Microsoft technologies itcampro@ itcamp14#
WINDOWS PHONE 8.1 DEVELOPER PLATFORM
Premium community conference on Microsoft technologies itcampro@ itcamp14#
One Windows
Apps come to life on Windows• Live tile improvements• Action Center for smart
notifications• Background execution + triggers• Bluetooth-LE support for wearables• Internet Explorer 11
improvements
Designed once; engaging
everywhere• Converged developer platform• Converged app model• Shared app identities + entitlement• Unified push services (via WNS)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Convergence
Windows Phone 7.5 Windows Phone 8.0 Windows Phone 8.1
Convergence Begins with IE
• WP 7.5 shipped with IE9
• Same rendering engine as Windows
• Same JavaScript engine as Windows
Converged Core (NT kernel)
• Common kernel & file system
• Kernel mode driver framework
• Secure boot & storage encryption (BitLocker)
• Core networking stack
Developer Platform
• Partial API convergence (focus on sensors & IAP)
• Native Code (C++) and DirectX
• IE10
Converging the Dev Platform
• More skillset reuse
• More code reuse
• More seamless app experiences
Aligning the Stores
• Shared dev registration
• Shared entitlement
Common Core Platform
• Proximity & Location
• Security & identity
• Task scheduler
Premium community conference on Microsoft technologies itcampro@ itcamp14#
API Convergence Windows Runtime (WinRT)Dramatic convergence in 8.1• Goal is 100% convergence for dev scenarios• In 8.0, we had ~30% API convergence• With 8.1, we move well past 90%+
convergence
CommonWinRT APIs
Phone-specificWinRT APIs
Windows-specificWinRT APIs
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Windows Developer Platform in 8.1
Windows Runtime API Set
Graphics Audio Media
Networking File System Input
Commerce
Sensors
.NET CLR
Windows Runtime (WinRT)
DirectX(C++)
Windows Phone
Silverlight(C# | VB)
Windows XAML
(C# | VB | C++)
WinJS(HTML +
JS)
App Model Services
Navigation
Packaging
Contracts
Background
Store(s)
Push
Roaming
Windows Kernel
App Data
Backup
Legend
Windows Phone Only
Windows OnlyWindows + Windows Phone
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Programming Models
DirectX/Direct3D
C++
WinRT
Gaming
WinRT
Store Apps with HTML
JavaScript
WinRT
HTML XAML
Windows Phone Store Apps with
XAML
C#/VB or C++
WinRT
Windows Silverlight 8.1 XAML
C#/VB
WinRT
.NET BCL .NET BCL
…others
XAML + Web-
Browser control hybrid
Web apps
.NET BCL
Premium community conference on Microsoft technologies itcampro@ itcamp14#
BUILDING A SHARED WINDOWS PHONE & STORE APP
DEMO
Premium community conference on Microsoft technologies itcampro@ itcamp14#
NEW FEATURES FOR DEVELOPERS IN WINDOWS PHONE 8.1
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Converged Windows XAML Apps
Developers can create a single app that targets Windows Phone and Windows
• One Visual Studio ‘Universal app’ project template for your app
• Shared dev and test tooling for both platforms
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Windows Phone app using JavaScript & HTML
Developers can use their HTML/CSS and JavaScript skills to create native apps that run on Windows Phone, similar to Windows
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Common canvas for Screen Diversity
10” tablet
7” tablet
6”
5”
4.5”
Infinite virtual canvas
166 Logical DPI
Shared virtual layout canvas
Premium community conference on Microsoft technologies itcampro@ itcamp14#
View Pixels
12:38
width
heig
ht“raw” pixels
12:38
width
heig
ht
“view” pixels
divide byscale factor
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Scale Factor
12:38
width (inch)
pixels
scale factor = pixels / width x platform constant
scale factor minimum of 1.0, rounded to nearest 0.2
platform constant depends on viewing distance of device (phone/tablet/PC)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
View Pixels
12:38
540
960
5.5”12:38
5.5”
720
1280
12:38
5.5”
1080
1920
450
800
“view” pixels
increasing scale factor
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Emulator support
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Converged Controls
80% exact same XAML 20% custom
Common SignatureButton
CheckBox
RadioButton ProgressBar
Slider
ToggleSwitchHubPivotListViewGridView
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Tailoring UI to each platform
On Windows Phone 8.1 … and on Windows 8.1
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Animations
Signature Phone animations built in– Page Navigation– PointerDown/Up (Tilt)– Page Rotation– Escalator for MenuFlyout (context menu)– Readerboard
ThemeTransitions / ThemeAnimations– Same API as on Windows– Key animations updated to match Phone UX
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Multitasking: Background tasks and Triggers
Task
TimeTriggerPUSH
Notification
LocationTrigger
PushNotificationTrigger
MaintenanceTrigger
InternetAvailable NetworkStateChange
TimeZoneChange
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Shared Tiles and Notification Services
Windows Notification Service (WNS)• Shared push service for Windows + Phone• Improved queuing to limit lost
notifications due to intermittent network connectivity
Tile templates + toasts• Shared tile templates (more!)• Periodic tile updates• Toasts
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Action Center
Action Center– Central location to surface missed
notifications– Apps can intelligently manage
notifications (silently add, update, and delete notifications)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Data Roaming and Data Backup
Device B
WP 8.1 – PFN 12345
Roaming Local LocalCache Temp
Device A
WP 8.1 App
Roaming LocalLocalCache Temp
Roaming
Backup [Device A]
• Local– Primary local store– Can be backed up to users’
OneDrive
• Roaming– Data roamed cross-device– Limited to 100kb
• Temp– Temporary storage– Cleaned up in low storage
condition
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Share Contract
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Maps and Geofencing
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Media, Media Editing and Background Audio
Video Editing(Phone only – not available on Windows 8.1)
Background Audio & Streaming Media
MediaFoundation Access
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Bluetooth LEHeart rate monitors and other sensorsProximity detectors (Key finder)Developers can use the Bluetooth GATT APIs to access Bluetooth LE services, descriptors, and characteristics
Bluetooth RFCommConnect, host, and communicate with Bluetooth RFCOMM device services Devices using Serial Port Profile (SPP) are supportedClient and server Service Discovery Protocol (SDP)
Background Tasks and TriggersApp can receive Bluetooth data when its running in the backgroundLaunch when a Bluetooth event occurs
Bluetooth
Premium community conference on Microsoft technologies itcampro@ itcamp14#
DEMO BLE – HEART RATE MONITOR
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Enterprise Enhancements
Mobile device management (MDM)More policy supportClient Certificate authenticationConvergence with Windows cryptography APIsWi-Fi & VPNS/MIMEApplication management
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Identity, identification, SSO
Microsoft Account SSOWeb Authentication Broker (WAB)
Authenticate to online service providers over OauthSSO mode enables user to completely bypass log-in pageSimple API
CredentialLockerWindows.Security.Credentials APIs to store credentials (user name, password) securelyIsolation: Apps can only access their own credentialsCredentials roam across trusted devices (works for WAB and IE too!)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Better HTML5 support
Ability to code pinning behavior• Specify high-resolution site icons• Live tiles using notifications
Professional quality video• Adaptive streaming• Secure viewing• Accessibility improvements
WebGL supportWeb spec based on OpenGL ES 2.0, to enable use of low-level 3D graphics APIs on web sites and HTML-based apps
Rich user interactions• Screen + device orientation APIs• Pre-fetch and pre-render
Premium community conference on Microsoft technologies itcampro@ itcamp14#
SDK Emulator improvments
Hyper-V based emulator
improvements:
Network
Multi-touch emulation with mouse
SD card
Location improvements
Push simulation
Locally simulate push notifications
Save and load data samples
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Windows Phone Power Tools
AppVerifierFind resource leaks and vulnerabilities in native apps
Performance Monitor Real time diagnostics
Performance Recorder ETW trace capturing
Premium community conference on Microsoft technologies itcampro@ itcamp14#
And more
Email with Attachments
SL XAML/ Direct3D
enhancements
FileOpenPicker, FileSavePicker
Read/Write access to SD
card
Wallet cards Known Folders (Audio/Video/:Pi
ctures)
Appointments/ Calendar API
enhancements
Appointments/Calendar
brokered UI
Sensors: Accelerometer, light, magnet …
Data Sense 2 WinRT HttpClient
Graphics enhancements
D2D/DWrite
Social RT AtomPub, Http, Syndication
(Windows.Web)
Advertising ID Data.XML
Premium community conference on Microsoft technologies itcampro@ itcamp14#
GETTING STARTED
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Windows Dev Center
http://dev.windows.com\
Premium community conference on Microsoft technologies itcampro@ itcamp14#
The tools
The Windows Developer Center is your base for all things Windows and Windows Phone relatedhttp://dev.windows.com http://dev.windowsphone.com
FREE download: Visual Studio Express 2013 for WindowsEnables development for Windows 8.1 and Windows Phone 8.1
In Visual Studio 2013 Professional or higher, install Update 2 to add in Windows Phone 8.1 dev tools
Premium community conference on Microsoft technologies itcampro@ itcamp14#
PC Requirments
Supported operating systems Windows 8.1 (x86 or x64)
Hardware4 GB of free disk space1.5 GB of RAM (recommended)64-bit (x64) motherboard
To use the Windows Phone Emulators
Windows 8.1 Pro or higher (for Hyper-V) and Second Level Address Translation (SLAT)Min 4GB RAM
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Windows Developer Account
You need a developer account to publish Windows Phone and/or Windows Store apps, to use Push Notifications and to unlock more than one phone for development
To get a Developer Account:• Included if you have an MSDN subscription• Free to students who have a Dreamspark subscription• $19 charge per annum for individual developers, $99 for Company
accounts
Premium community conference on Microsoft technologies itcampro@ itcamp14#
DEVELOPER CHOICES
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Programming Models
DirectX/Direct3D
C++
WinRT
Gaming
WinRT
Store Apps with HTML
JavaScript
WinRT
HTML XAML
Windows Phone Store
Apps with XAML
C#/VB or C++
WinRT
Windows Silverlight 8.1
XAML
C#/VB
WinRT
.NET BCL .NET BCL
…others
XAML + Web-
Browser control
hybrid Web apps
.NET BCL
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Application Lifecycle: Silverlight vs WinRT
Tombstoned
Not running
Running
LaunchingClosing
DeactivatingActivating
Dormant
Not running
Running
OnLaunched
SuspendingResuming
Suspended
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Choices
Approach Pros & Cons
Keep using Silverlight 7.x/8(Windows Phone 8 platform)
Pros Will run on Windows Phone 8.1 (app compatibility),
still runs on earlier Windows Phone devices
Cons Will not take advantage of new platform capabilities Will not enable targeting of Windows
Use Silverlight 8.1(Move Silverlight app into new execution stack and app package)
Pros Enables existing Silverlight apps to take advantage of
nearly all new APIs and platform capabilities
Cons Will not enable targeting of Windows Will not run on Windows Phone 8 devices
Use Windows XAML platform
Pros
Enables targeting of Windows and Windows Phone Takes full advantage of new APIs and platform
capabilities Better performance & reduced memory use
Cons Will not run on Windows Phone 8 devices
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Silverlight Only
CameraCaptureTask
Camera Lenses
Lockscreen background image provider
Runs under Lock
Background Audio Agent
Alarms/Reminders
SocialRT (Silverlight 8.1 only)
VoIP
Continuous background location tracking (SL 8.0 only)
Wallet agents
System.ServiceModel (WCF/SOAP)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Upgrade Silverlight 8.0 to 8.1
Background Tasks & Triggers
AppX Packaging
WNS Notifications
New Tile Templates
Action Center Management
App Data Roaming &
Backup
Credential Locker
Share Contract
SD card r/w access
GeoFencing Email with Attachments
SL XAML/ Direct3D
enhancements
Bluetooth LE and RFCOMM
Cryptography Web Authentication
Broker
Premium community conference on Microsoft technologies itcampro@ itcamp14#
WINDOWS PHONE 8.1 PRINCIPLESPrimary features:
Existing Windows Phone 8 apps run flawlessly
Windows Runtime XAML platform and HTML/WinJS support brings convergence with Windows 8.1, and is faster and uses less memory than Silverlight
The core of an app can be built once for Windows and Windows Phone; you can share elements of UI, though it’s best to tailor the user experience for each platform
Convergence is not just in the developer platform: it spans tools, store, commerce
Developer investment in the existing Silverlight platform is protected: Existing Silverlight apps can be upgraded to access new Windows Phone 8.1 platform capabilities
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Q & A