Windows Phone Introduction

50
Windows Phone 8 Programming Introduction

description

Giới thiệu lập trình trên nền tảng Windows Phone - Design - Market share - Application Type - Development Tool - Features - Application LifeCycle

Transcript of Windows Phone Introduction

Page 1: Windows Phone Introduction

Windows Phone 8 Programming Introduction

Page 2: Windows Phone Introduction

Nguyen Thanh Tung

• CSA at MISA JSC• Mostly working with Microsoft technologies:

• XAML• Silverlight• Entity Framework• ASP.NET• Windows Phone• Windows 8 and more

• http://tungnt.net• https://www.facebook.com/tungnt185

Page 3: Windows Phone Introduction

Agenda

• Windows Phone 8 (WP8) introduction

– The most interesting features

– Marketshare

• WP8 application lifecycle, software architecture & deployment process

• Developing tools

– Microsoft Visual Studio 2013 & Expression Blend

– VS2013 project template

– Third party control for designing user interface (UI)

• C# basics

Page 4: Windows Phone Introduction

History of Microsoft Mobile OS

Windows CE OS (2000)

Windows Mobile (2003 – 2009)

Windows Phone 7 (11/2010)

Windows Phone 7.5 Mango (5/2011)

Windows Phone 8 & 7.8

(10/2012)

Windows Phone 8.1 (8/2014)

Page 5: Windows Phone Introduction

Windows® Phone 8

A different kind of phone designed to bring together what you care about most – easier and faster

Smart designGlance and go experienceDesigned to do more in less steps

Windows Phone HubsOrganized to get everything you love easier and faster

Optimized EcosystemRich platform and tools on optimized hardware

Page 6: Windows Phone Introduction

Smart Design

• Metro Styles

• App Bar

Page 7: Windows Phone Introduction

Hubs

• People

• Office

• Pictures

• Music & Video

• Marketplace

• Games

• Wallet

Page 8: Windows Phone Introduction

Top 3 Smartphone OS

Page 9: Windows Phone Introduction

Windows Phone Market Share

Page 10: Windows Phone Introduction

VietNam Smartphone Market Share

Page 11: Windows Phone Introduction
Page 12: Windows Phone Introduction
Page 13: Windows Phone Introduction

Windows Phone Store

More than 300.000 app

Page 14: Windows Phone Introduction

Monetizing With Windows Phone App

• Paid App:

– 0.99$, 499$...

• Free App with Advertising:

– PubCenter, AdMod

– VServ, MobFox …

• In-App Purchases:

– New Add-ons, New Items, New

level…

Page 15: Windows Phone Introduction

One App Model, three technology choices*

– XAML with C#/VB

– Native C/C++

– HTML5 browser control

*Not exclusive, can mix and match

Three Flavors of Applications

Page 16: Windows Phone Introduction

Windows Phone 8 app models

Direct3D AppC++

XAML AppC# / VB

Windows Phone 8 API Set

Graphics Audio Media

File System Networking Input

Commerce Base Types Sensors

Common.NET FX

CoreCLR

Direct3DInterop

C++Reuse

Page 17: Windows Phone Introduction

Deployment Process

Develop & Debug

Submit& Validate

Certify & Sign

Windows Phone Application Deployment Service

Marketplace

• Store deployment

Page 18: Windows Phone Introduction

Deployment Process

• Company enrollment

Page 19: Windows Phone Introduction

Tool for developing WP8 application• Features:

– Develop three types application:

• XAML with C#/VB

• Native C/C++

• HTML5 browser control

– Windows Phone 8 Emulator for testing apps

– Power debugging capabilities of Visual Studio family

– Designer support good enough to create the UI

Page 20: Windows Phone Introduction

Microsoft Expression Blend for WP

Expression Blend is used to design beautiful User Interface:

– You can build amazing experiences relatively easy

– Has a learning curve, especially for developers

• The tool is powerful but use it ‘wisely’ for Windows Phone UI design

• The tool of choice for transitions / animations

• Has great support for showing / testing data driven UI elements

– Can be used in combination with Visual Studio 2013

• Uses the same Windows Phone Emulator to test experiences

Page 21: Windows Phone Introduction

Microsoft Expression Blend for WP

Page 22: Windows Phone Introduction

Visual Studio’s project template• New and Updated

Project Templates

– HTML5, Localization Support, Alignment Grid

– Direct3D support with Native C++

Page 23: Windows Phone Introduction

Visual Studio’s project template

Template DescriptionWindows Phone Application Creates a project that can be used as a starting point

for any Silverlight for Windows Phone application. Windows Phone Databound Application Creates a project that uses the ListBox control and

navigation features. In addition, this template creates an application using the Model-View-ViewModel design pattern.

Windows Phone Class Library Creates a class library project that compiles as an assembly by default. This template has no UI elements and can be shared with other applications.

Windows Phone Panorama Application Creates a project that uses a Panorama control that allows you to view controls, data, and services by using a long horizontal canvas that extends beyond the confines of the screen.

Windows Phone Pivot Application Creates a project that uses a Pivot control to enable the you to switch between views or pages within the application.

• Windows Phone project template

Page 24: Windows Phone Introduction

Visual Studio’s project templateTemplate Description

Windows Phone XAML and Direct3D App

Creating a Windows Phone managed application with native components.

Windows Phone Silverlight and XNA Application

Creates a project that enables the rendering of Silverlight and XNA Framework content in the same application.

Windows Phone HTML5 AppCreating a Windows Phone application that uses primarily HTML content.

Windows Phone Audio Playback Agent Creates a class library project for adding a background agent to play audio files.

Windows Phone Audio Streaming Agent Creates a class library project for adding a background agent to play streaming audio files.

Windows Phone Scheduled Task Agent Creates a class library project for adding a background agent to perform a periodic or resource-intensive task. Three types of project above compiles as an assembly by default and can be referenced by Silverlight or XNA Framework application projects.

Page 25: Windows Phone Introduction

Visual Studio’s project template

Template Description

Windows Phone Direct3D with XAML App A project for creating a Windows Phone application that uses Direct3D and XAML.

Windows Phone Direct3D App (Native Only) A project for creating a Windows Phone app that uses Direct3D.

Windows Phone Runtime Component A project for creating a Windows Phone Runtime component for a Windows Phone app.

Windows Phone Empty Dynamic Link Library A project for creating a native dynamic-link library for a Windows Phone app.

Windows Phone Empty Static Library A project for creating a native static library for a Windows Phone app

• C++ project template

Page 26: Windows Phone Introduction

WP8 the most interesting featuresNew Hardware

• Multi-Core Chipsets

– Dual-Core & more…

e.g. Qualcomm Snapdragon S4

Page 27: Windows Phone Introduction

WP8 the most interesting features3 Screen Resolutions

WVGA800x480 (15:9)

WXGA1280x768 (15:9)

720p1280x720 (16:9)

*New graphics hardware means that existing apps auto-scale and look amazing on all screens.

Page 28: Windows Phone Introduction

WP8 the most interesting featuresMicroSD Supporte.g. Photos, Music, Videos, Installing Apps

Page 29: Windows Phone Introduction

WP8 the most interesting featuresInternet Explorer 10• Same rendering engine as Windows 8 PCs

• SmartScreen anti-phising filter

• 4x faster JavaScript performance compared toWindows Phone 7.5

• 2x HTML5 feature support compared to Windows 7.5 (e.g. touch support)

Page 30: Windows Phone Introduction

WP8 the most interesting featuresNative Code

• Common platform for Windows

Phone 8 and Windows 8

• Native game development platform

based on DirectX, C / C++

• Games developers can write the

same game for Windows 8 and

Windows Phone

Page 31: Windows Phone Introduction

WP8 the most interesting features• Better Sharing with NFC

Tap-to-share, etc…

• Magazine Ads

• Business Cards

• NFC enabled phones

• Windows Surface

• Matchmaking (e.g. gaming over p2p network)

• Most Complete Wallet Experience

– Credit & Debit Cards

– Loyalty & Membership Cards

– Access Saved Deals

– Supports NFC ‘Tap to Pay’

– In-App-Purchases

* Secure SIM-based solution in partnership with mobile operators, will see these next year in US, but not at time of launch.

Page 32: Windows Phone Introduction

WP8 the most interesting features

• Nokia Map Technology

– Great global NAVTEQ

Map data

– Offline map support

– Map control for

developers

– Turn-by-Turn Directions

Page 33: Windows Phone Introduction

WP8 the most interesting features

• For Business

– Sign and deploy apps without going through marketplace

– Company Hub

Page 34: Windows Phone Introduction

WP8 the most interesting featuresNew Start Screen

Page 35: Windows Phone Introduction

Panorama control• Part of the native Windows Phone look and feel

• Panorama is a long horizontal canvas

• PanoramaItem serves as a container that hosts other content and controls

Page 36: Windows Phone Introduction

Pivot control

• Provides a quick way to manage views or pages

• Pivot is a container of pivot items

• PivotItem contain individual page content such as controls, grids, or links

Page 37: Windows Phone Introduction

Location and Services• The service obtains

location data from multiple sources such as A-GPS, Wi-Fi, and cellular

• Allows you to create location-aware applications

• Allow location-tracking application to run in the background Location

Services

+ Accuracy- Power- Speed- Indoors

- Accuracy+ Power+ Speed- Wilderness

+/- Accuracy+/- Power+/- Speed+/- Urban areas

GPS

Cell Towers

WiFi

Page 38: Windows Phone Introduction

Push Notifications

Page 39: Windows Phone Introduction

Types of Push Notifications

• Tile notifications

– Update tile count, title and background image

• Toast notifications

– Display a on-top-like message

• Raw notifications

– Can be used in application logic

Page 40: Windows Phone Introduction

Accelerometer, Compass, Gyroscope

• Motion APIs

– Accelerometer determine direction the user is moving the device

– Compass determine the relative angle of rotated device

– Gyroscope determine rotational velocity of device

+Y

-Y

+X-X

+Z

-Z

Page 41: Windows Phone Introduction

Demo Project Template

Page 42: Windows Phone Introduction

WP8 Application Lifecycle

Page 43: Windows Phone Introduction

Obscured: popup ui from shell

Running

Obscured

Running

Unobscured

Games could auto-pause

Game could auto-resume

• Phone call

• Reminder

• Battery low

Page 44: Windows Phone Introduction

Paused: jump to another app

Running

Pause

Suspended

Resume

Assume your process is killed

Save state for later use

Load state to continue where you left off

User never knows what happened :-)

• Start Button

• Accept call• Open toast

Page 45: Windows Phone Introduction

Demo Application Lifecycle

Page 46: Windows Phone Introduction

Application manifest

• File: WMAppManifest.xml

– Contains properties and settings that are required when you submit your app to the Windows Phone Store

– Ex: Describe your app to OS by Product title …

Page 47: Windows Phone Introduction

Building the first WP8 applicationItem Description

App.xaml / App.xaml.cs Defines the entry point of the application, initializes application-scoped resources, and displays the application user interface

MainPage.xaml / MainPage.xaml.cs Defines a page with the user interface of the application

ApplicationIcon.png An image file with an icon that represents the application icon in the phone’s application list

Background.png An image file with an icon that represents the application icon in the start screen

SplashScreenImage.jpg This is the image that will first be displayed when the application launches.

Properties\AppManifest.xml An application manifest file required to generate the application package

Properties\AssemblyInfo.cs Contains the name and version metadata that is embedded into the generated assembly

Properties\WMAppManifest.xml A manifest file that includes specific metadata related to a Windows Phone Silverlight application

References folder A list of libraries (assemblies) that provide services and functionality that the application requires to work

Page 48: Windows Phone Introduction

Remember things

• XAML (eXtensible Application Markup Language)

• ApplicationLifetimeObject

– PhoneApplicationService

• RootFrame

– PhoneApplicationFrame

• PhoneApplicationPage

Page 49: Windows Phone Introduction

3rd control for designing application UI

Page 50: Windows Phone Introduction

Summary

• Windows Phone 8 (WP8) introduction

• WP8 software architecture & deployment process

• Tool for developing WP8 application

– Microsoft Visual Studio 2012

– Microsoft Expression Blend

• Project template for creating WP8 application

• WP8 application lifecycle

• Third party control for designing application user interface