SlideShare una empresa de Scribd logo
1 de 50
Pou Mason
                poumason@live.com
     http://www.dotblogs.com.tw/pou


Windows Phone
   技術分享
大綱

Windows Phone SDK 7.1
  – Architecture
  – Execution Model for Windows Phone
  – Using Isolated storage
  – Using Live Tile & Controls
  – Chooser and Launcher
  – Multitasking for Windows Phone
即將到來的Windows Phone 8
Windows Phone SDK 7.1
Concept

Windows Phone SDK 7.1 Architecture
Runtime, Tools, Cloud Services, Portal
 Services
Application Development Lifecycle
Architecture – 1/2
Architecture – 2/2

Runtime
  – Silverlight and the XNA Framework
Tools
  – Visual Studio, Expression Blend
Cloud Services
  – Windows Azure, XBOX Live, Notification
    Services, and Location Services, …
Portal Services
  – Windows Phone Marketplace
Runtimes
Application Development Lifecycle
Silverlight & XNA Framework

Silverlight
  – 適用開發應用程式類的App,也可以開發遊戲
  – WP與Windows在Silverlight的不同
     • Implementation Differences Between Silverlight and
       Silverlight for Windows Phone
XNA
  – 適用開發遊戲與多媒體應用程式
究竟該開發那一種與選擇Framework
     • The Silverlight and XNA Frameworks for Windows
       Phone
Execution Model – 1/6

Windows Phone應用程式的生命週期
類型
 – Application State
 – Application Events
 – Page State
 – Page Events
 – Tombstoning
 – State Dictionaries
Execution Model – 2/6

Application
  – Data that is used by multiple pages in an
    application.
Page
  – The current visual state of a single application
    page.

                                  Page      Page       Page



                                         Application
Execution Model – 3/6

Application Events
  – Launching
  – Deactivated
  – Activated
  – Closing
Page Events
  – PhoneApplication Page
    • OnNavigatedTo
    • OnNavigatedForm
Execution Model – 4/6

Tombstoning (墓碑)
  – 應用程式久未使用或被回收,非走Closing離開
    程式,應用程式被視為墓碑
  – App裡的所有資源被回收
Terminated (休眠)
  – 應用程式從前景換到背景,未被回收時,視為休
    眠模式 (或稱暫停)
  – 資源仍存在,回到App時可以繼續使用
搭配Deactivated與Activated
    Reference: Windows Phone 7 - 簡介新運作模式 - Dormant
Execution Model – 5/6

Deactivation
  – 代表App將由前景轉換背景模式前的事件
  – 保存Page或Application中必要的資料
Activation
  – 代表App由背景轉換前景時的事件
    • 背景轉前景與由Start再啟動App完全不同
       – iOS / Android 二個視為相同
  – 還原必要資料至Page或Application
Execution Model – 6/6
                              (1)

Application Lifecycle
             (6)



                               (2)
                        (5)




                        (4)
          (5’)
                               (3)


                 (‘4)
Page之間的切換 – Navigation – 1/2

PhoneAlicationFrame
  – 一個Application有一個Frame
  – 工作
    • PhoneApplicationPage之間的資料交換
    • 結合App.xaml控制ApplicationPage內的內容與控件
    • 控制PhoneApplicationPage的切換
PhoneApplicationPage
  – Application呈現的單位,UI控件的集合處


         References: Navigation Framework原理概論
Page之間的切換 – Navigation – 2/3

關聯模塊
Page之間的切換 – Navigation – 3/3

Page切換原理
Isolated Storage – 1/3

Application專屬儲存區
 – Sandbox機制,每個App具有獨立的I/O空間
 – App之間無法交換資料
 – 無法辦法直接訪問File System取得資料
 – 提高安全性,降低未經授權的訪問和數據損壞的
   可能性
Isolated Storage – 2/3

Data Storage Options
Isolated Storage – 3/3

Special-use Folders
 Path                   Use                             Note
 Shared                 管理Media、ShellContent與           App安裝時自動建立,可
                        Transfer三個資料夾。                  被刪除。
 Shared/Media           Album Art:App利用該資料夾呈            App安裝時自動建立,可
                        現Album Art,配合Background         被刪除。常搭配多媒體應
                        Audio一起使用。                      用時,儲存媒體資料。
 Shared/ShellContent    Application Tiles: 用於呈現每個一 App安裝時自動建立,可
                        Tile在Font/Back的底層資訊,配      被刪除。配合Live Tiles時
                        合Live Tiles時使用。            使用。
 Shared/Transfer        Background file transfer:用於存放   App安裝時自動建立,可
                        背景下載的檔案,配合                      被刪除。配合Background
                        Background Transfer元件使用。        Transfer元件使用。


   – 也可依需求建立自訂的目錄結構
Isolated Storage vs. XAP

Isolated Storage
     – App安裝後所產生的儲存區
XAP Resource
     – XAP為App實際安裝檔
          • 與Android中的Assets相似
               – 可在應用過程裡,直接將XAP中的資訊Copy至Isolated
                 Storage進行操作
               – XAP裡的資料是不可以修改
     – XAP中的資料隨著專案打包時
          • Content 與 Resource包裝上的差異
Reference: Windows Phone 7 – TitleContainer.OpenStream與App.GetResourceStream - 讀取XAP內資源的方法
Local Database – 1/2

Architecture
  – DataContext
    • 輕量的Entity Framework
       – 沒有工具,要描述一個DB,全部要手動建立
  – LINQ to SQL Runtime
    • 所有的交易一律透過OR Mapping,沒有SQL




        References: Windows Phone 7 – Local Database概論 - 2
Local Database – 2/2

Supported Properties
  – data source : isostore/appdata
  – password : 40 characters
    • AES-128, SHA-256
  – max buffer size: 384~5120 (kilobytes)
  – max database size: 32~512 (megabytes)
  – mode
    • read write/read only/exclusive/shared read
Live Tile – 1/3

Tile
  – WP獨特的概念元素,可呈現App資訊、互動項
    目與通知內容
  – 搭配Push Notification、Schedule排程等,動態
    的調整Tile的內容
  – Tile的動態特效,由系統控制,到了WP8有更豐
    富的呈現機制
Live Tile – 2/3

Application Tile
  – The font of a tile
  – Only one


Secondary Tiles
  – The back of a tile
  – User can custom


   References: Windows Phone 7 - 學習新的Secondary Tile與Application Tile
Live Tile – 3/3

修改Tiles的機制
 – ShellTile APIs
    • Application Tile and Secondary Tiles can be created,
      updated, and deleted
 – Tile Notifications
    • Tile properties can be updated by using the Microsoft
      Push Notification Service
 – ShellSchedule APIs
    • The background images on the front of a Tile can be
      updated on a recurring schedule, even if your
      application is not running.
Controls & Toolkits

Controls
  – Supported Controls in Windows Phone
Silverlight for Windows Phone
  – Silverlight for Windows Phone Toolkit
Unsupported controls
  – ComboBox, TreeView, OpenFileDialog, …
Chooser & Launcher

Launchers and Choosers Overview for
 Windows Phone
Chooser
  – 呼叫系統內部應用程式,並有回傳值
  – Choosers for Windows Phone
Launcher
  – 呼叫系統內部應用程式,執行固定任務
  – Launchers for Windows Phone

     References: Windows Phone 7 - 更多元的Microsoft.Phone.Tasks
MultiTask – 1/2

Background Agent
  – 獨立於App之外的特殊背景元件
    • 建置時屬於不同的專案
       – Android, iOS中不具有該類項目,但各自有對應的背景機制
  – 與App之間無法直接溝通
    • 統一透過Isolated Storage進行資料交換
Lifecycle
  – 一個App只有一個Agent
  – NotifyComplete(), Abort()
  – ScheduleToast
MultiTask – 2/2

Background Transfer
  – 提供佇列一至多個檔案在背景下進行上傳、下載
Background Audio
  – 支援App在非前景下仍可以播放音樂
Background Schedule Tasks
  – 支援安排App在背景時可以處理特定的任務
    • Periodic Task
       – 適用執行較短時間的任務,執行隔間具有規律週期性
    • Resource-intensive Task
       – 適用需要執行較長時間的 任務,只有設備在指定狀況下使用
Application Features

Application Features for Windows Phone
  – Application Bar
  – MusicHub, Picture Hub
  – Contacts and Calendar
  – Location, Media
  – Push Notification
  –…
References

Gesture Support for Windows Phone
Performance Considerations in Applications
 for Windows Phone
Code Samples for Windows Phone
Windows Phone Training Course
Windows Phone Development QuickStarts
Mobile Platform Development
Windows Phone 8
    即將到來
偷看Windows Phone 8 Emulator的內容
功能特性一覽表

New platform & APIs
Multi-resolution
Speech
Tile and Notifications
Lock Screen
In-app purchasing
Proximity, Bluetooth, Wallet extensibility
Introduction

WP8
 – 採用與Win 8相同的Runtime,並增加更豐富支
   援手機應用與硬體整合的APIs
   • Win8:WinRT
   • WP8:WinPRT
 – 支援COM、Win32 APIs
 – 不支援
   • Javascript直接存取WinRT APIs
WinRT vs. WinPRT




綠色代表相同的,白色代表新增加的部分,只適用於WP8中的WinPRT
Multi-resolution – 1/2

WVGA, XVGA, 720p




 – WP7.1的App需要重新調整Layout佈局
   • XVGA, 720p更要小心處理
Multi-resolution – 2/2
Speech

互動方式
 – Voice Commands
   • 透過語音指令deep-link應用程式
      – 可自訂的指令語言
 – Speech Recognition & Text-to-Speech APIs
   • 透過語音進行輸入,以及讀出用戶輸入的文字
      – 利用基於雲計算的語音識別網絡搜索和聽寫,或建立更複雜
        的互動
New Tiles – 1/3

Flip Tile Template
New Tiles – 2/3

Cycle Tile Template
  – Describes a tile template that cycles between 1
    to 9 background images.
New Tiles – 3/3

Iconic Tile Template
Lock Screen

Lock screen background image
  – a user can choose to use an app as its lock
    screen background provider
Lock screen notification Area
  – provide content on the lock screen
    • App icon (24x24 pixel)
    • App count
    • App text


         References: 偷看Windows Phone 8 Emulator的內容
In-app purchasing – 1/3

Overview
In-app purchasing – 2/3

Develop provide
  – products that can be sold in your app
  – clear and accurate product information
  – the ability to initiate a purchase from within your
    app, that is, a “buy button”
  – product delivery and/or enablement, also known
    as fulfillment
In-app purchasing – 3/3

Microsoft provide:
  – product management tools through App Hub
  – geo-distributed services
  – a purchase user experience that is consistent
    across all apps on the phone
  – the ability to pay you in 190 countries or regions
  – proof of purchase authenticity through secure
    receipts
Proximity & Bluetooth

Proximity
  – establish a connection between your app and
    another instance of your app on another,
    nearby, phone.
    • NFC
Bluetooth
  – enable apps to communicate over Bluetooth.
    Using this API, an app can connect to another
    app, or to a device
Wallet extensibility

Store payment instructions, deals, and
 loyalty cards.
Manage the payment instruments that they
 use in the app and music store.
Link items in the wallet to apps on their
 phone.
Make contactless transactions, using near
 field communication (NFC), in certain
 markets.
Q&A
Thanks for your listening

Más contenido relacionado

Destacado

Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheory
Meetu Maltiar
 
Jeopardy Christmas
Jeopardy ChristmasJeopardy Christmas
Jeopardy Christmas
cdaleyccs
 

Destacado (12)

Medición de la calidad en Programas de Postgrado
Medición de la calidad en Programas de PostgradoMedición de la calidad en Programas de Postgrado
Medición de la calidad en Programas de Postgrado
 
Replant: a new generation of botanical art
Replant: a new generation of botanical artReplant: a new generation of botanical art
Replant: a new generation of botanical art
 
BizTalk練習投影片
BizTalk練習投影片BizTalk練習投影片
BizTalk練習投影片
 
Getting Started With Scala
Getting Started With ScalaGetting Started With Scala
Getting Started With Scala
 
Getting Started With Scala
Getting Started With ScalaGetting Started With Scala
Getting Started With Scala
 
Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheory
 
Fitnesse With Scala
Fitnesse With ScalaFitnesse With Scala
Fitnesse With Scala
 
Xmasquiz
XmasquizXmasquiz
Xmasquiz
 
WP8.1 Tiles and Notifications
WP8.1 Tiles and NotificationsWP8.1 Tiles and Notifications
WP8.1 Tiles and Notifications
 
Jeopardy Christmas
Jeopardy ChristmasJeopardy Christmas
Jeopardy Christmas
 
Christmas Jeopardy
Christmas JeopardyChristmas Jeopardy
Christmas Jeopardy
 
如何使用Azure mobile service
如何使用Azure mobile service如何使用Azure mobile service
如何使用Azure mobile service
 

Similar a Windows Phone Concept - 7.1 & 8 Preview

"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap
Christian Rokitta
 
Windows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with SilverlightWindows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with Silverlight
Rishu Mehra
 
ACCESS_WP_Hiker_App_framework-web
ACCESS_WP_Hiker_App_framework-webACCESS_WP_Hiker_App_framework-web
ACCESS_WP_Hiker_App_framework-web
Paul Plaquette
 

Similar a Windows Phone Concept - 7.1 & 8 Preview (20)

IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
 
Feed Herny developer training : crossplatform and HTML5
Feed Herny developer training : crossplatform and  HTML5Feed Herny developer training : crossplatform and  HTML5
Feed Herny developer training : crossplatform and HTML5
 
redpill Mobile Case Study (Salvation Army)
redpill Mobile Case Study (Salvation Army)redpill Mobile Case Study (Salvation Army)
redpill Mobile Case Study (Salvation Army)
 
Better IT Operations and Security through Enhanced z/OS Analytics: New Featur...
Better IT Operations and Security through Enhanced z/OS Analytics: New Featur...Better IT Operations and Security through Enhanced z/OS Analytics: New Featur...
Better IT Operations and Security through Enhanced z/OS Analytics: New Featur...
 
Xoriant Smartphone apps accelerator
Xoriant Smartphone apps acceleratorXoriant Smartphone apps accelerator
Xoriant Smartphone apps accelerator
 
Windows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's NewWindows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's New
 
Android application development fundamentals
Android application development fundamentalsAndroid application development fundamentals
Android application development fundamentals
 
Pentesting iPhone applications
Pentesting iPhone applicationsPentesting iPhone applications
Pentesting iPhone applications
 
"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap
 
Windows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with SilverlightWindows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with Silverlight
 
DF14: Drive Salesforce User Productivity with the Pebble SmartWatch
DF14: Drive Salesforce User Productivity with the Pebble SmartWatchDF14: Drive Salesforce User Productivity with the Pebble SmartWatch
DF14: Drive Salesforce User Productivity with the Pebble SmartWatch
 
Apache cordova
Apache cordovaApache cordova
Apache cordova
 
Mobile Application Development class 001
Mobile Application Development class 001Mobile Application Development class 001
Mobile Application Development class 001
 
ACCESS_WP_Hiker_App_framework-web
ACCESS_WP_Hiker_App_framework-webACCESS_WP_Hiker_App_framework-web
ACCESS_WP_Hiker_App_framework-web
 
01 introduction
01 introduction01 introduction
01 introduction
 
Silverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternSilverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel Pattern
 
Development Workshop on ET1, Android and Motorola RhoElements
Development Workshop on ET1, Android and Motorola RhoElementsDevelopment Workshop on ET1, Android and Motorola RhoElements
Development Workshop on ET1, Android and Motorola RhoElements
 
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
 
Oracle and Mobile, From Design to Device; The tools that make it happen - Use...
Oracle and Mobile, From Design to Device; The tools that make it happen - Use...Oracle and Mobile, From Design to Device; The tools that make it happen - Use...
Oracle and Mobile, From Design to Device; The tools that make it happen - Use...
 
Windows phone7 subodh
Windows phone7 subodhWindows phone7 subodh
Windows phone7 subodh
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Windows Phone Concept - 7.1 & 8 Preview

  • 1. Pou Mason poumason@live.com http://www.dotblogs.com.tw/pou Windows Phone 技術分享
  • 2. 大綱 Windows Phone SDK 7.1 – Architecture – Execution Model for Windows Phone – Using Isolated storage – Using Live Tile & Controls – Chooser and Launcher – Multitasking for Windows Phone 即將到來的Windows Phone 8
  • 4. Concept Windows Phone SDK 7.1 Architecture Runtime, Tools, Cloud Services, Portal Services Application Development Lifecycle
  • 6. Architecture – 2/2 Runtime – Silverlight and the XNA Framework Tools – Visual Studio, Expression Blend Cloud Services – Windows Azure, XBOX Live, Notification Services, and Location Services, … Portal Services – Windows Phone Marketplace
  • 9. Silverlight & XNA Framework Silverlight – 適用開發應用程式類的App,也可以開發遊戲 – WP與Windows在Silverlight的不同 • Implementation Differences Between Silverlight and Silverlight for Windows Phone XNA – 適用開發遊戲與多媒體應用程式 究竟該開發那一種與選擇Framework • The Silverlight and XNA Frameworks for Windows Phone
  • 10. Execution Model – 1/6 Windows Phone應用程式的生命週期 類型 – Application State – Application Events – Page State – Page Events – Tombstoning – State Dictionaries
  • 11. Execution Model – 2/6 Application – Data that is used by multiple pages in an application. Page – The current visual state of a single application page. Page Page Page Application
  • 12. Execution Model – 3/6 Application Events – Launching – Deactivated – Activated – Closing Page Events – PhoneApplication Page • OnNavigatedTo • OnNavigatedForm
  • 13. Execution Model – 4/6 Tombstoning (墓碑) – 應用程式久未使用或被回收,非走Closing離開 程式,應用程式被視為墓碑 – App裡的所有資源被回收 Terminated (休眠) – 應用程式從前景換到背景,未被回收時,視為休 眠模式 (或稱暫停) – 資源仍存在,回到App時可以繼續使用 搭配Deactivated與Activated Reference: Windows Phone 7 - 簡介新運作模式 - Dormant
  • 14. Execution Model – 5/6 Deactivation – 代表App將由前景轉換背景模式前的事件 – 保存Page或Application中必要的資料 Activation – 代表App由背景轉換前景時的事件 • 背景轉前景與由Start再啟動App完全不同 – iOS / Android 二個視為相同 – 還原必要資料至Page或Application
  • 15. Execution Model – 6/6 (1) Application Lifecycle (6) (2) (5) (4) (5’) (3) (‘4)
  • 16. Page之間的切換 – Navigation – 1/2 PhoneAlicationFrame – 一個Application有一個Frame – 工作 • PhoneApplicationPage之間的資料交換 • 結合App.xaml控制ApplicationPage內的內容與控件 • 控制PhoneApplicationPage的切換 PhoneApplicationPage – Application呈現的單位,UI控件的集合處 References: Navigation Framework原理概論
  • 17. Page之間的切換 – Navigation – 2/3 關聯模塊
  • 18. Page之間的切換 – Navigation – 3/3 Page切換原理
  • 19. Isolated Storage – 1/3 Application專屬儲存區 – Sandbox機制,每個App具有獨立的I/O空間 – App之間無法交換資料 – 無法辦法直接訪問File System取得資料 – 提高安全性,降低未經授權的訪問和數據損壞的 可能性
  • 20. Isolated Storage – 2/3 Data Storage Options
  • 21. Isolated Storage – 3/3 Special-use Folders Path Use Note Shared 管理Media、ShellContent與 App安裝時自動建立,可 Transfer三個資料夾。 被刪除。 Shared/Media Album Art:App利用該資料夾呈 App安裝時自動建立,可 現Album Art,配合Background 被刪除。常搭配多媒體應 Audio一起使用。 用時,儲存媒體資料。 Shared/ShellContent Application Tiles: 用於呈現每個一 App安裝時自動建立,可 Tile在Font/Back的底層資訊,配 被刪除。配合Live Tiles時 合Live Tiles時使用。 使用。 Shared/Transfer Background file transfer:用於存放 App安裝時自動建立,可 背景下載的檔案,配合 被刪除。配合Background Background Transfer元件使用。 Transfer元件使用。 – 也可依需求建立自訂的目錄結構
  • 22. Isolated Storage vs. XAP Isolated Storage – App安裝後所產生的儲存區 XAP Resource – XAP為App實際安裝檔 • 與Android中的Assets相似 – 可在應用過程裡,直接將XAP中的資訊Copy至Isolated Storage進行操作 – XAP裡的資料是不可以修改 – XAP中的資料隨著專案打包時 • Content 與 Resource包裝上的差異 Reference: Windows Phone 7 – TitleContainer.OpenStream與App.GetResourceStream - 讀取XAP內資源的方法
  • 23. Local Database – 1/2 Architecture – DataContext • 輕量的Entity Framework – 沒有工具,要描述一個DB,全部要手動建立 – LINQ to SQL Runtime • 所有的交易一律透過OR Mapping,沒有SQL References: Windows Phone 7 – Local Database概論 - 2
  • 24. Local Database – 2/2 Supported Properties – data source : isostore/appdata – password : 40 characters • AES-128, SHA-256 – max buffer size: 384~5120 (kilobytes) – max database size: 32~512 (megabytes) – mode • read write/read only/exclusive/shared read
  • 25. Live Tile – 1/3 Tile – WP獨特的概念元素,可呈現App資訊、互動項 目與通知內容 – 搭配Push Notification、Schedule排程等,動態 的調整Tile的內容 – Tile的動態特效,由系統控制,到了WP8有更豐 富的呈現機制
  • 26. Live Tile – 2/3 Application Tile – The font of a tile – Only one Secondary Tiles – The back of a tile – User can custom References: Windows Phone 7 - 學習新的Secondary Tile與Application Tile
  • 27. Live Tile – 3/3 修改Tiles的機制 – ShellTile APIs • Application Tile and Secondary Tiles can be created, updated, and deleted – Tile Notifications • Tile properties can be updated by using the Microsoft Push Notification Service – ShellSchedule APIs • The background images on the front of a Tile can be updated on a recurring schedule, even if your application is not running.
  • 28. Controls & Toolkits Controls – Supported Controls in Windows Phone Silverlight for Windows Phone – Silverlight for Windows Phone Toolkit Unsupported controls – ComboBox, TreeView, OpenFileDialog, …
  • 29. Chooser & Launcher Launchers and Choosers Overview for Windows Phone Chooser – 呼叫系統內部應用程式,並有回傳值 – Choosers for Windows Phone Launcher – 呼叫系統內部應用程式,執行固定任務 – Launchers for Windows Phone References: Windows Phone 7 - 更多元的Microsoft.Phone.Tasks
  • 30. MultiTask – 1/2 Background Agent – 獨立於App之外的特殊背景元件 • 建置時屬於不同的專案 – Android, iOS中不具有該類項目,但各自有對應的背景機制 – 與App之間無法直接溝通 • 統一透過Isolated Storage進行資料交換 Lifecycle – 一個App只有一個Agent – NotifyComplete(), Abort() – ScheduleToast
  • 31. MultiTask – 2/2 Background Transfer – 提供佇列一至多個檔案在背景下進行上傳、下載 Background Audio – 支援App在非前景下仍可以播放音樂 Background Schedule Tasks – 支援安排App在背景時可以處理特定的任務 • Periodic Task – 適用執行較短時間的任務,執行隔間具有規律週期性 • Resource-intensive Task – 適用需要執行較長時間的 任務,只有設備在指定狀況下使用
  • 32. Application Features Application Features for Windows Phone – Application Bar – MusicHub, Picture Hub – Contacts and Calendar – Location, Media – Push Notification –…
  • 33. References Gesture Support for Windows Phone Performance Considerations in Applications for Windows Phone Code Samples for Windows Phone Windows Phone Training Course Windows Phone Development QuickStarts Mobile Platform Development
  • 34. Windows Phone 8 即將到來 偷看Windows Phone 8 Emulator的內容
  • 35. 功能特性一覽表 New platform & APIs Multi-resolution Speech Tile and Notifications Lock Screen In-app purchasing Proximity, Bluetooth, Wallet extensibility
  • 36. Introduction WP8 – 採用與Win 8相同的Runtime,並增加更豐富支 援手機應用與硬體整合的APIs • Win8:WinRT • WP8:WinPRT – 支援COM、Win32 APIs – 不支援 • Javascript直接存取WinRT APIs
  • 38. Multi-resolution – 1/2 WVGA, XVGA, 720p – WP7.1的App需要重新調整Layout佈局 • XVGA, 720p更要小心處理
  • 40. Speech 互動方式 – Voice Commands • 透過語音指令deep-link應用程式 – 可自訂的指令語言 – Speech Recognition & Text-to-Speech APIs • 透過語音進行輸入,以及讀出用戶輸入的文字 – 利用基於雲計算的語音識別網絡搜索和聽寫,或建立更複雜 的互動
  • 41. New Tiles – 1/3 Flip Tile Template
  • 42. New Tiles – 2/3 Cycle Tile Template – Describes a tile template that cycles between 1 to 9 background images.
  • 43. New Tiles – 3/3 Iconic Tile Template
  • 44. Lock Screen Lock screen background image – a user can choose to use an app as its lock screen background provider Lock screen notification Area – provide content on the lock screen • App icon (24x24 pixel) • App count • App text References: 偷看Windows Phone 8 Emulator的內容
  • 45. In-app purchasing – 1/3 Overview
  • 46. In-app purchasing – 2/3 Develop provide – products that can be sold in your app – clear and accurate product information – the ability to initiate a purchase from within your app, that is, a “buy button” – product delivery and/or enablement, also known as fulfillment
  • 47. In-app purchasing – 3/3 Microsoft provide: – product management tools through App Hub – geo-distributed services – a purchase user experience that is consistent across all apps on the phone – the ability to pay you in 190 countries or regions – proof of purchase authenticity through secure receipts
  • 48. Proximity & Bluetooth Proximity – establish a connection between your app and another instance of your app on another, nearby, phone. • NFC Bluetooth – enable apps to communicate over Bluetooth. Using this API, an app can connect to another app, or to a device
  • 49. Wallet extensibility Store payment instructions, deals, and loyalty cards. Manage the payment instruments that they use in the app and music store. Link items in the wallet to apps on their phone. Make contactless transactions, using near field communication (NFC), in certain markets.
  • 50. Q&A Thanks for your listening