MSDN Blogs - Microsoft

Windows 8 Coding, Tools &
Windows Azure Mobile Services
Peter Kirchner
Technical Evangelist
Microsoft Deutschland
[email protected]
blogs.msdn.com/pkirchner
twitter.com/peterkirchner
27.02.2013
Windows 8
Installation von Apps
Store anatomy
Windows Store app acquisition
Building blocks of an app package
 App Manifest contains all
information needed to deploy
the app
 Blockmap contains hashes
of all files within the app package
 Signature validates the
integrity of the app package
App manifest and capabilities
 Explicitly declares the app integration endpoints
 File capabilities (music/pictures/videos/documents libraries,
removable storage)
 Devices (webcam, microphone, location, sms, proximity);
extensible to new device classes
 Network and identity (internet, private network, credentials)
 File type associations
 App contracts (search, share, etc.)
 Contained in appxmanifest.xml;
Visual Studio provides editor
Ausführung
Process state transitions
App gets 5s to handle
suspend
User
Launches
App
Apps are notified
when they have been
resumed
Splash
screen
App is not notified
before termination
Process Isolation
Entwicklung
Demos & Dokumentation
 Umfangreiche Beispiele im Windows 8 SDK
 http://code.msdn.microsoft.com/windowsapps
 Windows Dev Center
 http://msdn.microsoft.com/windows/apps
Windows 8 Platform
Windows Runtime APIs
Language projections
Roaming
Implementing Search
Search Anatomy
1. Search box is scoped to
the main app on screen
2. Query suggestions provided
by the main app on screen
• Autocompletes to terms for
which the app has search results
3. List of installed Metro style apps that
have implemented the search contract
Search Anatomy
4. Result recommendations
• Must include a thumbnail and title
• Indicates a strong or exact match result
• Takes users directly to the details of the result
5. Results
• Show the count or not found
• Be pertinent
• Allow search refinement
with filters for example
Implementing Search
• Search contract sample (Windows SDK)
Implementing Share
Informationen teilen
 Quell-App bietet Informationen zum Teilen an
 Quell-App muss Ziel-Apps nicht kennen
 Ziel-App empfängt Informationen und verarbeitet
diese
 Ziel-Apps muss Quell-Apps nicht kennen
 Windows 8 orchestriert Kommunikationsfluss
 Apps kommunizieren nicht direkt miteinander
Sharing From Source to Target
Registers with the
DataTransfer Manager
User selects “Share”,
active app is sent event
Receives event and
fills DataPackage
Filters list of Target
Apps and Quicklinks
Completes Async
calls and returns
User selects Target
App or Quicklink
Activate Target
as kind shareTarget
Activated for sharing
Processes
DataPackage contents
Reports Complete
Data Package
 Plain text
 Formatted text
 URI
 HTML
 Images
 Files
 Custom data formats
Implementing Share
• Sharing content source app sample (Windows SDK)
• Sharing content target app sample (Windows SDK)
Live Tiles
Basic Tiles
 Tap on tile to launch or
switch to an app
 Static default tile specified
in app manifest
 Both sizes can have live
updates
Square (1x1)
Wide (2x1)
Live Tiles
Notification Queuing
Secondary Tiles
Live Tiles
• App tiles and badges sample (Windows SDK)
• Secondary tiles sample (Windows SDK)
Toast Notifications
Toast Notifications
 Toast notifications deliver
 Allows quick navigation to a
 Use toast notifications to get
 Toast notifications are easy to
transient messages outside the
context of the app
user’s attention immediately
 User is in control and can
permanently turn off toast
notifications from your app
contextually relevant location in
your app
invoke from your app or from
the cloud
Toast Templates
 Toast notifications use the same
template architecture as Live
Tiles
 Rich set of rendering options
available
Toast Notifications
• Scheduled notifications sample (Windows SDK)
• Toast notifications sample (Windows SDK)
Windows Notification Service
(WNS)
Windows Notification Service
 Enables delivery of tile and toast notifications over the
internet.
 Tile updates and notifications shown to the user even if
your app is not running.
 WNS handles communication with your app
 Scales to millions of users
 WNS is a free service for your app to use
Push Notification Overview
1. Request Channel URI
2. Register with your
3.
Cloud Service
Authenticate & Push
Notification
Stay Connected
•
•
•
•
Background task sample (Windows SDK)
Push and periodic notifications client-side sample (Windows SDK)
Raw notifications sample (Windows SDK)
Windows Azure Mobile Services
What is Windows Azure Mobile Services?
Key Scenarios
Windows Azure Mobile Services are ideal for:
Structured Storage
 Structured Storage with SQL Database
 If using single database apps are partitioned by schema

AppX.Todoitem

AppY.Todoitem
 Manage data in

Portal

SQL Portal

SQL Management Studio

REST API…
Server Logic
 Automatic service REST API generated for
storage
 Dynamic Schema on/off
 Ability to author server logic that intercepts
CRUD operation pipeline
 Rich querying capability
Server Logic
 Supported Modules + Globals
 mssql
mssql.query('select top 1 * from statusupdates',
 request
{ success: function(results) {
console.log(results);
 console
}
 push
}
);
 tables
 statusCodes
REST API to SQL type mappings
JSON Value
Numeric values (integer,
decimal, floating point)
Boolean
DateTime
String
T-SQL Type
Float
Bit
DateTimeOffset(3)
Nvarchar(max)
Push Notification Lifecycle Overview
1. Request Channel URI
2. Register with your
Cloud Service
3. Authenticate &
Push Notification
Push Notifications
 Integrates with WNS to provide Toast, Tile and
Badge notifications
 Portal captures your WNS client secret and
package SID
 push.wns.* provides:
 clean easy object model to compose
notifications
 Performs auth against WNS for you
Auth*
 Authenticate against Windows Live
 Table level permissions for each CRUD operation
 Everyone
 Anyone with the Application Key
 Only Authenticated Users
 Only Scripts and Admins
 More granular control with server side scripts
 user.level: {admin, authenticated, anonymous}
 user.userId: id or undefined if not authenticated
Windows Azure Mobile Services
• www.windowsazure.com/mobile
Free offer during preview
Running on
shared
instances
1GB SQL
Database
From WA Free Trial
10 Mobile
Services
No SLA during Preview. Only small instances available. Can upgrade to a reserved instance at 33%
discount from normal Pay-As-You-Go rates during Preview.
Ressourcen für App-Entwickler
KOSTENLOSER APP-SUPPORT
Ihr direkter Einstieg
App-Entwickler Hotline
E-Mail-Support
STUDENTENANGEBOTE
www.msdn-online.de/myapp
0800 – 6087338 (kostenfrei aus dem dt. Festnetz)
[email protected]
KOSTENLOSE
VERANSTALTUNGEN
MSDN DEVELOPER
CENTER
www.msdn-online.de/win8events
www.msdn-online.de/events
www.msdn-online.de/windows
www.msdn-online.de/windowsphone
www.msdn-online.de/azure
www.techstudent.de