MCSD: Windows Store Apps

advertisement
Windows 8 Store Application
Development Using HTML5 and
JavaScript
Judy McNeil
BSCS MCAD MCSD MCTS MCTIP MCT
www.netcomlearning.com
Today’s Content
•
•
•
•
•
•
•
Charms and Contracts
The Search Contract
The Share Contract
Tiles
Badge Notifications
Configuring for Deployment
Deploying to the Windows Store
www.netcomlearning.com
Charms
• Windows 8 has five charms:
• Search: Look for files, settings, and apps on the
computer, as well as search within apps
• Share: Share content between apps
• Start: Suspends active app and displays the Start
screen
• Devices: Send data and documents to external
devices
• Settings: View app information and change
preferences
www.netcomlearning.com
Contracts
• A Windows 8 contract is an agreement
between the app and Windows
– Apps that implement contracts make use of
operating system support
• Contracts are declared in the app manifest,
Package.appxmanifest
• Simplifies interactions between apps
– Abstracts the implementation details of other
apps
– Reduces the number of integration scenarios
www.netcomlearning.com
The Search Contract
• Users can search your
app from the Search
pane if you implement
the Search contract
•
Add Search to the list of
declarations in the app
manifest
• Apps can provide search
query suggestions and
result suggestions
www.netcomlearning.com
Search Suggestions
• Search suggestions help users
discover what your app has to offer
•
•
Search suggestions are autocompletions of the query
Result suggestions are direct links to an
app page
• Only the first five suggestions are
shown in the search pane
www.netcomlearning.com
Search Activation
• The app is chosen from the search pane
•
This is called main view activation because the app is in the
foreground
• The app’s constructor is called, but OnLaunched is not
• Add event listener to the activated function in your
WinJS.Application object
www.netcomlearning.com
Share Source Contract
Windows 8 provides a framework for apps to share content with
other apps
The Share Target contract is declared in the manifest, unlike the
Share Source contract.
Source App
Registers
DataRequested event
handler with the
DataTransferManager
Receives event and fills
DataPackage in event
handler
DataPackage lives in
source app
Share Broker
The user selects “Share.”
The active app is sent a
DataRequested event
Filters list of target apps
and QuickLinks
Target App
At installation, registers
as ShareTarget through
manifest declaration
User selects target app or
QuickLink
Activated for sharing
Activates the target app
in a hosted view
Processes the contents of
DataPackage
Records a QuickLink if
the target app returned
one
Reports Complete
www.netcomlearning.com
Shared Data Types
• Supported data formats are: text, URI, bitmap,
HTML, StorageItems, and RTF
– By using StorageItems you can transfer objects of
any class that implements the IStorageItem
interface, including files
• You can share with a custom format
– You are responsible for converting objects to byte
streams and back (serialization/deserialization
www.netcomlearning.com
The Share Target Contract
• To be listed in the
Share pane, an app
must declare itself a
Share Target in the
manifest
• The app must support
at least one data
format or file type
• The app must provide
a sharing UI
www.netcomlearning.com
Share Target Activation
• Share target activation means that the app
must supply a hosted view UI
• In the ready event handler, you should check
the activation type:
– Windows.ApplicationModel.Activation.Activatio
nKind.shareTarget activation type indicates that
the app was activated for share
– The options parameter of the ready function will
contain the shareOperation object which contains
all shared data
www.netcomlearning.com
Polls
www.netcomlearning.com
Demo
• Implementing the search contract
www.netcomlearning.com
Tile Templates
www.netcomlearning.com
Updating Tiles Locally
<tile>
<visual>
<binding template="TileWidePeekImageCollection03">
<image id="1" src="image1.png" alt="alt text"/>
<image id="2" src="image2.png" alt="alt text"/>
<image id="3" src="image3.png" alt="alt text"/>
<image id="4" src="image4.png" alt="alt text"/>
<image id="5" src="image5.png" alt="alt text"/>
<text id="1">Lorem ipsum dolor Ame
Consectetur adipiscing</text>
</binding>
</visual>
</tile>
www.netcomlearning.com
Badge Notifications
Number of unread email messages
Number of apps awaiting download
Numeric badge
Glyph badge
www.netcomlearning.com
Creating a Badge Notification
var badgeXml =
Notifications.BadgeUpdateManager.getTemplateContent(Notifications.Badge
TemplateType.badge Number);
var badgeAttributes = badgeXml.getElementsByTagName("badge");
badgeAttributes[0].setAttribute("value", "58");
// Create a badge notification from the XML content.
var badgeNotification = new Notifications.BadgeNotification(badgeXml);
// Send the badge notification to the app's tile.
Notifications.BadgeUpdateManager.createBadgeUpdaterForApplication().upd
ate(badgeNotificat ion);
www.netcomlearning.com
Demo
• Implementing Tiles
www.netcomlearning.com
Application UI
• Use the application UI section to customize basic visual
features of the app
– Basic information
• Display name, description, language
– Tile
• Background images for three tile sizes
• Background color
– Notifications
• Toasts, lock screen notifications
– Splash screen
• Image file or image resource
• Background color
www.netcomlearning.com
Demo
• Application UI
www.netcomlearning.com
Capabilities Section
• The Capabilities section defines which system features or
devices Windows allows your app to use
–
–
–
–
–
Internet (client, client and server)
User’s documents, pictures, music, and video libraries
Webcam and microphone
Location information
Removable storage
• Check only capabilities that your app requires
• Special capabilities are available only to apps published under
company accounts
• General capabilities are available to every account
www.netcomlearning.com
Declarations Section
• Declarations section defines specific functionalities that your
app provides
– Contracts are functionalities that your app declares it provides when
interacting with other apps
• Cached file updater, file open picker, file save picker, search, share target
– Extensions are functionalities that your app declares it provides when
interacting with Windows
• AutoPlay, camera settings, contact picker, game explorer, and more
– Declarations have properties that describe their use by the app
• Some are required for the project to build
www.netcomlearning.com
Packaging Section
• Packaging section lets you specify the identity of
the app
– Name and display name
– Store logo
• Represents the app in the Windows Store
– Version
• [Major].[Minor].[Build].[Revision]
– Certificate
• Test certificate automatically generated by Visual Studio
• Store certificate generated when packages are created for
upload to the store
– Publisher display name
www.netcomlearning.com
Demo
• Capabilities
• Declaration
• Packaging
www.netcomlearning.com
The Windows Store
• Submitting apps to the Windows Store requires a Windows
Store developer account
– Annual payment required to remain active
– Linked with a Microsoft account
– Two kinds of developer accounts
• Individual
• Company
• Manage your store account and app submissions on the
dashboard
– Update your developer profile, submit apps, view and edit apps in
progress, view and update apps in the store, explore store trends, and
view a financial summary
www.netcomlearning.com
The Publishing/Certification Process
• Use the Windows Store dashboard to submit
apps for certification and publishing
– Complete all parts of the submission: app name,
selling details, advanced features, age rating and
rating certificates, cryptography, packages,
description, and notes to testers
• Before submitting an app for certification
– Make sure that the app meets all requirements for
a Windows Store app
– Check technical compliance by using the Windows
app Certification Kit
www.netcomlearning.com
Store Certification Requirements
• Windows Store apps must meet some minimum requirements
to be accepted for publishing
• Generally, apps must:
–
–
–
–
–
–
Provide value to the customer
Be more than just ads or websites
Behave predictably
Put the customer in control
Be appropriate for a global audience
Be easily identified and understood
• This is an incomplete list. Not meeting any requirement will
result in certification failure.
www.netcomlearning.com
Store Tools
• Visual Studio provides store tools to help with
app publishing
– Found on the STORE menu or by right-clicking a
project and selecting the Store submenu
– Most important options are Associate App with the
Store and Create App Packages
• Associating an app with the store links the project on a
development computer with the store’s app submission
• The app package is the .appxupload file that has the correct
certificate so that you can upload to the store
– Other options help with your developer account,
reserving app names, capturing screen shots, and
uploading packages to the store
www.netcomlearning.com
Submitting an app
to the Windows Store
• Manage your app submissions from the Windows Store
Dashboard:
www.netcomlearning.com
Submitting an App: App Name
Submitting an App
Selling Details
Submitting an App
Advanced Features
www.netcomlearning.com
Submitting an App
Age Rating and Rating Certificates
Submitting an App
Cryptography
www.netcomlearning.com
Submitting an App
Packages
www.netcomlearning.com
Submitting an App
Description
www.netcomlearning.com
Submitting an App
Notes to Testers
www.netcomlearning.com
Windows 8 Enterprise
App Deployment
• Enterprise app deployment means deploying apps within
an organization instead of to the general public
• Enterprise apps should:
•
•
•
•
Pass WACK tests
Have correct manifests
Be certified
Meet your organization’s software requirements
• The certificate must come from a certification authority
trusted by the target computers
• Target computers must enable side-loading
www.netcomlearning.com
Upcoming Webinars
•
Free Webinar: Windows 8 Development - HTML5 with Live Demo
•
Free Webinar: Windows Server 2012 DHCP & Data Duplication
•
Webinar: Windows 8 HTML5 Apps with Azure Backends | Live Demo
•
Free Webinar: Windows Server 2012 and Windows 8: Better Together
•
Free Webinar: Java 7 Certification | JDBC & Related Design Pattern
•
Free Webinar: Transition | Microsoft Office 2003 to Office 2010 | Outlook &
Access
•
Free Webinar: Microsoft Dynamics CRM | A New Way to Work Together
Sign up for free at: www.netcomlearning.com/webinars
www.netcomlearning.com
MCSD: Windows Store Apps
*Free Second Shot Exam is Back (Expires May 31st, 2013)
www.netcomlearning.com
Upgrade Paths
www.netcomlearning.com
MCSD: Windows Store Apps Using C#
Classes
MCSD: Windows Store Apps Using HTML5
•
•
•
20480: Programming in HTML5 with JavaScript and CSS3
20481: Essentials of Developing Windows Store Apps using HTML5 and JavaScript
20482: Advanced Windows Store Apps Development using HTML5 and JavaScript
Upcoming Class:
•
•
April 29th in New York City & Live Online
June 24th in New York City & Live Online
Locations: Attend in-class or Live Online Instructor-led
•
•
•
•
New York
Las Vegas (All Inclusive Travel Package)
Arlington VA
Philadelphia, PA
www.netcomlearning.com
Q&A
1-888-5-NETCOM (563-8266)
info@netcomlearning.com
www.NetComLearning.com
Download