Windows Store與Unity入門

(本文是 “Getting started on Windows Store with Unity” 文件的簡單中譯版本,出處為Unity官網中對 Unity 遊戲建置為 Windows Store/Windows Phone App 的四份正式文件其中之一)

入門: Windows Store與Unity

本文件將持續更新以提供最即時的資訊。若有此文件未能解決之處,請嘗試至Unity Windows Developer Forum中搜尋或發問: http://forum.unity3d.com/forums/50-Windows-Development

簡介

Unity 4.3 ,以及更新的版本,已讓移植Unity遊戲至 Windows Store變得更加容易。

這份文件是為Unity開發人員所寫,提供他們將現有的Unity遊戲移植為Windows Store App所需要的概觀資訊。此文件並未包含所有技術細節,但它能指引您正確的方向並提供相關的外部連結,以獲取進一步的詳細資訊。

移植 (porting) 一個 Unity 遊戲至Windows Store遊戲

要開發、編譯您的Unity 遊戲並提交到 Windows Store ,您將需要:

– Unity4.3: Unity免費版本或Unity Pro都可,兩者皆內建免費的 Windows Store和 Windows Phone add-ons 給所有的Unity開發者。

–  Visual Studio: 您可以使用任何 Visual Studio SKU,包括免費的 Visual Studio Express版本。若要移植至 Windows 8.1 將需要 Visual Studio 2013 ;若要到 Windows 8 則可以使用 Visual Studio 2012。這兩種版本可以在同一台電腦上一併安裝並執行。

–  Windows 8.0 或更高的版本: 即便您未購買 Windows 8,您也可以在http://dev.windows.com 取得 90 天的免費評估版。如果您是在Apple的機器上執行 Mac OS X ,可以有幾種選項讓您選擇以執行Windows,例如Boot Camp, VMWare 或是Parallels等。若您的目標是 Windows 8.1,則您必須在 Windows 8.1 中開發。其實,我們建議的執行環境是在Windows 8.1上執行Visual Studio 2013,原因是這樣的環境可以讓您自由選擇要移植至Windows 8或是Windows 8.1。附帶一提的是,從 Windows 8.0 升級到 Windows 8.1 是免費的,而且可直接由Windows Store中進行升級。

– Microsoft Account: Microsoft Account是免費的,可由以下網站申請 http://signup.live.com,有此 Microsoft 帳戶即可獲取免費的開發許可(Developer License)。

–  Windows Store 帳戶: 這是在您要將遊戲上架至 Windows Store時的需求。您可選擇要註冊為個人或公司帳戶,一旦完成註冊後則可同時提交至  Windows Phone Marketplace。個人帳戶註冊費用為$19,公司帳戶為$99。(譯註: 學生身份或新創公司則可享有第一年免年費優惠,可分別至http://DreamSpark.com 及http://BizSpark.com 申請)

–  Windows 測試機: 您可以在所有執行 Windows 8.0/8.1 的任何設備上進行開發及測試,Visual Studio 內建的模擬器可以模擬諸如多點觸控、各種螢幕解析度等情境;但是,我們仍建議您在具有觸控及運行Windows RT (ARM-based CPU)的實體機器上測試您的App。理想的選擇包含Surface RT 或Surface 2。

 

移植概述

要準備移植至Windows Store,您可由以下領域熟悉其流程:

– 設計階段 — — Unity Editor 經驗

– 編譯階段 — — 從Unity Editor 生成 Windows Store App

– 執行階段 — — 執行 Windows Store App

 

設計階段 — — Unity Editor 經驗

您將繼續使用所熟悉的Unity編輯器來移植遊戲至Windows Store App,這會提升您的工作效率。

在遊戲設計階段的程序是相同的,您在Unity編輯器內的Mono執行環境(run-time)中設計並執行您的遊戲。只有在您要編譯成 Windows Store專案時會注意到一些差別: Unity將使用Windows Store的.NET core (核心)來進行編譯。這裡提到的.NET core是.NET 的一個子集,因此,您可能會遇到一些編譯錯誤,其原因即來自於某些API存在於Mono的執行環境中,但並不存在於.NET core之中。若遇到這種情形您將得改寫程式碼使其能順利執行。移植技術的詳細資訊,請閱讀Porting tips for Windows Store with Unity這份文件。(譯註,或參閱以下部落格文章的step-by-step解決方法: http://blogs.msdn.com/b/mengtsai/archive/2014/01/16/unity-game-to-windows-store-compile-error-missing-namespaces-classes.aspx)

一旦成功編譯為Windows Store專案後,您即可以直接使用 Visual Studio 打開所生成的 Windows Store解決方案並進行debug。

另一個可能的差異,是發生在使用shaders和graphics功能的時候,原因是這兩項是硬體相依的功能;例如,若您在編輯器中使用PC的硬體功能設定,其硬體功能當然遠勝於ARM-based的 Windows RT 設備。而若要在設計階段時模擬實際的設備功能,請使用Unity的圖形模擬(Graphics Emulation- 位於Edit功能表)來選擇適當的目標平臺。

在Unity專案中包括 Windows Store程式碼

如果您有一些程式碼,是要在Windows Store環境下才執行,但在Unity Editor環境下不該被執行的話,可以使用 #if (UNITY_METRO & &!UNITY_EDITOR) 這個pre-processor指令。(譯註: 自Unity 4.3.3起,若要編譯為Windows 8.0請使用UNITY_METRO_8_0,若為Windows 8.1請使用UNITY_METRO_8_1。http://unity3d.com/unity/whats-new/unity-4.3.3 )。這將確保程式碼僅在所生成的Windows Store App內執行。其中!UNITY_EDITOR 是在處理於Editor中執行File->Build Settings切換到 Windows Store App時的情境。另外,請注意在Unity編輯器中執行的程式碼是不能引用 Windows run-time (WinRT) 中的 API的。WinRT API 包括了一些針對Windows 8/8.1平台的特別功能,如尋訪檔案系統及SkyDrive、使用動態磚(Live Tiles)或Contracts等;要使用這些API的話,可以在建置為Windows Store專案中後,於Visual Studio中來實作以上項目。

編譯階段–從Unity Editor 生成 Windows Store App

您將透過File -> Build Settings來切換您所要建置的遊戲執行平台:

image

您將看到右側有幾個新的選項,以下是關於這些選項的詳細資訊:

 

選擇Windows Store的類型 (Type)

在Type的下拉清單中您可以在 Direct3D11 和 XAML 之中作選擇,同時也可以在C# 或 C++語言間作選擇。我們建議先選擇XAML ,這可讓你在所見即所得的 XAML UI 設計畫面中,快速建立啟始畫面(splash screen)、設定(Settings)等各項 UI 元件。若選擇Direct3D & C++ 會生成較底層的執行元件,會有最好的執行效能,但是會犧牲一些 UI 元件設計時的整合功能而拉長設計時間。

有關這些選項的更多資訊,請參閱以下連結:

– Developing Windows Store Games – 概述了 DirectX 平臺功能的文章。

– Unlocking the Power of DirectX in Apps that use XAML – 解釋如何無縫整合 DirectX 與 XAML。

 

選擇 SDK

在Unity 4.3 您可以選擇要生成 8.0 或 8.1 版本的Windows Store App。

由於 Windows 8.1 已發佈,我們建議您選擇此為所有新遊戲的最新版本。然而,在本文件推出之時 (Nov 2013),仍有許多執行 Windows 8.0 的使用者。若要讓您的遊戲可以在8.0或8.1上皆能執行的話,您可以:

– 直接生成一個 Windows 8.0 遊戲而不使用8.1的新功能。在此情形下您將以8.0的版本提交到Store,上架後不論是執行 8.0 或 8.1 的使用者將能夠安裝並執行它。或者:

–針對8.0 和 8.1生成兩個Visual Studio 專案。在這情形下您將提交兩個遊戲套件(packages)至Store,任某版本作業系統上的使用者將只能看到其各自版本的遊戲。這種方式的優點在於可在8.1的專屬套件上新增8.1的特別功能(如Big Tile等),缺點則是需要同時控管兩種版本。

 

更多資訊請見:

Windows Store – What’s new or update in 8.1

Migrating Windows Store apps to Windows 8.1

 

Player Settings的設置和.Net 核心編譯

在Player Settings選項中,你會發現右側多了許多設定的選項以生成您的 Windows Store方案。這些設定會出現在您的Visual Studio專案中的manifest設定檔中。您可以直接在此設定應用程式名稱、 預設logo圖示、所需要的平台功能等。

image

其中請注意一個重要的設定,在Compilation Overrides的下拉選單中,其預設值是”Use Net Core”。

此預設值是要確保在編譯時,Unity中的所有scripts(但不包括 /Plugins 資料夾),都被編譯成.Net 核心設定檔。若您是做用C#的話這會是建議的設定。而如果您是使用 UnityScript (或是Boo)則將不能選擇.NET Core;這情形況Unity將使用Mono的編譯器,但仍然生成可通過Windows Store認證的assembly。

應指出的是,在這個編譯的過程中(按下Build後) 會忽略在 /Plugins 資料夾內的外掛程式及二進位檔案,也就是說即便您成功生成了Windows Store專案,您可能仍會在執行階段或上架Windows Store的驗證過程中遇到問題。

若要知道協力廠商的外掛程式是否相容於 Windows Store ,可以使用 Xamarin提供的線上工具免費掃描: http://scan.xamarin.com。

 

 

 

 

 

Windows Store專案和 Visual Studio-開發流程

以上我們提到所有可能遇到的問題,請參閱 Windows Store Porting Techniques 這份技術白皮書的Getting your app to compile in Unity章節中(第4~6頁),有更多如何解決 API 與相關錯誤的說明。 

一旦您已經解決了任何編譯時的錯誤,Unity將匯出一個專案檔,你將會使用 Visual Studio 打開、測試、執行並發布你的遊戲,亦即以下的兩個步驟:

1.從Unity生成專案。(File -> Build Settings,選擇Windows Store App -> Build)

2.在Visual Studio 中編譯為可上架Windows Store的二進位檔案

 

值得注意的是,每次以 Unity生成專案的時候,你可以每次都選擇相同的資料夾,這樣並不會覆寫到任何已在Visual Studio中所作過的修改。Unity將只更新的以下資料夾及檔案:

1. 在您專案中的/Data資料夾

2. 專案中的reference assemblies

亦即,您可以直接於Visual Studio 改變專案、添加更多功能、更改manifest或設定檔,即便您之後在Unity中更改了遊戲內容也不會丟失這些在 Visual Studio 中所作的改變。

另外要注意的是,如果您是更動了Unity的專案檔 (比如新增Plugins 或 references),您將需要手動合併您的 Visual Studio 專案檔案。

(本文僅譯至原文件的 Porting Overvew 章節)

  

Unity Labs: App遊戲開發實作 – 跨平台就這麼簡單 Unity X Windows

報名網站: http://www.accupass.com/go/unitywindowst1

App遊戲開發實作 - 跨平台就這麼簡單 Unity X Windows

Event Information

Unity 4.3 支援Windows Phone 以及Windows 8.1,你是否很想嘗試但礙於沒有環境呢?
這個課程,除了Unity台灣經銷商–奇銳科技工程師, 分享如何利用 Unity 移植遊戲到 Windows平台,更提供現場hands-on環境讓各位開發者挑戰!
[時間場地]
1.
時間:2014 / 02 / 22 (六)
13:30 ~ 17:30
2.
地點:台北市復興南路一段390號3樓 301資策會

image

[參加條件]
1. 已經有遊戲作品之開發團隊或個人
2. 每一家公司/團隊最多報名兩位.
[註]
1. 主辦單位保留參加資格審核權利
.
2.
活動場地可容納30名學員, 報名系統設定為35名以保留5名候補學員
[提供資源]
1. 台灣微軟提供各組 Windows Store 帳號 Token,可供一年份免費上傳 Windows Store Apps 或 Windows Phone Apps。
2. 教室會提供安裝好Unity 4.3試用版及Windows 8.1 及Windows Phone 8 SDK之開發環境, 但仍建議團隊帶自已的筆電與開發環境, 所需環境請參考 http://unity3d.com/pages/windows/porting
3.當天除PC外,會準備6台 Lumia 720 手機供開發測試用
4.台灣微軟提供各組 Windows Azure 一個月試用帳號。
5.台灣微軟將準備精美小禮物,送給於最終發表時使用 Windows 平板或手機裝置 demo 的組別。
[我還沒有作品]
本梯次課程優先保留給已經有作品之遊戲團隊, 如果您尚無完成之作品, 但仍想學習如何將Unity 遊戲發佈到Windows 8.1或Windows Phone平台上, 麻煩您仍然報名,並提供作品介紹。
[參考文件]

1. Unity移轉必讀
2. 如何將遊戲移植到Windows 8.1及Windows Phone 8
3. Windows 8到Windows 8.1


指導單位:經濟部工業局
主辦單位: 奇銳科技股份有限公司 、台灣微軟、財團法人資訊工業策進會數位教育研究所
如果有其他問題,請與執行單位聯絡:
e-mail: twbisv@microsoft.com

[Unity Game to Windows Store] Compile error- missing namespaces/classes

如以下,在 Unity 中 Switch Platform 至 Windows Store Apps 後 “Build”:

image

出現的錯誤訊息為: “error CS0103: The name ‘File’ does not exist in the current context”。

Unity 上開發的遊戲 porting 至 W8/WP 平台時,第一個也是最常遇到的問題,即是有某些 namespaces 及 classes 在 Mono run-time 中可以編譯,但卻因不存在於 W8/WP 的 run-time 中,而造成 Compile error 的情形。

我們先直接來解決它,之後會有較詳細的說明。

如何解決?

[以下環境以Unity 4.3.3 + Windows 8.1 + Visual Studio 2013 作說明,解法適用於 Windows Store App 及 Windows Phone 8]

步驟1: 請至https://aka.ms/UnityPortingSamples 下載位於 GitHub 中的 UnityPorting (C#) 專案 (Download ZIP),這個專案實作了許多 missing namespaces/classes,只要在 Unity 中的參考加入此專案建制出來的 .dll 檔即可解決這個常見的問題。

1-1. 解壓縮後,雙點位於 UnityPorting-masterUnityPorting-masterPlatformerPlugin 目錄下的 PlatformerPlugin.sln (會以 Visual Studio 2013 開啟)。

1-2. 刪除方案中的 Facebook 資料夾;「只」重新建置 MyPluginUnity 這個專案,因為我們僅需要其 MyPlugin.dll 檔! (建置後會在 UnityPorting-masterUnityPorting-masterPlatformerPluginMyPluginUnitybinDebug 目錄中)

imageimage

步驟2: 將 MyPlugin.dll 檔加入 Unity 的參考 (references) 中:

[2014/2/24更新] 用滑鼠把 MyPlugin.dll 檔拖拉至 Plugins 資料夾中即可:

image

回到 Unity ,點擊錯誤訊息,於發生錯誤的 .cs 檔案加入以下 Using directives,同時並記得將既有的 Using System.IO 移除。

#if UNITY_METRO_8_1 && !UNITY_EDITOR
using LegacySystem.IO;
#else
using System.IO;
#endif

image

請各位以所缺少的 classes 所在的 namespace 作相對應的修改;以上是以 System.IO 中所缺少的 classes 為例,以下則是缺少 System.Net 中的 Sockets 之例:

“error CS0234: The type or namespace name ‘Sockets’ does not exist in the namespace ‘System.Net’ (are you missing an assembly reference?)”

image

存檔後回到 Unity 重新 Build 即可發現錯誤已解決;若無其他錯誤的話即會發現在所選資料夾中已成功編譯出一個 Windows Store App 方案,點擊其 .sln 檔即可以 Visual Studio 開啟編譯。

原因及說明:

此問題發生的原因其實很簡單,Mono .NET 及 W8/WP .NET 這兩個 run-time 雖然都是屬於整體 .NET run-time 的子集合,但是兩個子集合圈圈之中,會有 namespaces/classes 不在交集內的情形 (藍色半月型區域):

image

MyPlugin.dll 這個檔案即是我們在以上步驟中的重點,在其中已實作了許多出現在 Mono run-time ,但卻未出現在 W8/WP run-time 的 namespaces/classes。 因此 Unity 開發者只要直接 Using 進來,即可在不更動既有的 classes 名稱下,編譯出相容於 W8/WP run-time 的遊戲;而又由於所有的 classes 名稱都沒被更動,因此不會影響遊戲在其他平台 (iOS/Android 等) 的相容性。

詳細來說,於步驟1所建置出來的 MyPlugin.dll 之中,至少實作了以下的 namespaces/classes:

– System.Collections 之中的: Hashtable, ArrayList, OrderedDictionary, SortedList, Queue, Stack and a few others.

– System.IO.File, System.IO.StreamReader, System.IO.Directory, etc.

– System.Net.TCPClient using Windows.Networking.Sockets WinRT namespace:

– System.Threading.Tread

– (optional) Facebook plugin

亦即若您的 Compile error 是因為找不到以上的 classes,那以上步驟都可以解決您的問題。

以上步驟的詳細說明請見這份 Unity3D/Microsoft 的官方文件Porting tips for Windows Store (813 KB) 中的第4 ~ 6 頁。

另,線上課程 (英文) Porting Unity games to Windows 8.1 & Windows Phone 中的 Module 3 就特別討論到 Duel Runtime environment ,建議一聽。

更完整 porting 至 W8/WP 平台的文件可見: http://unity3d.com/pages/windows/porting 

我常看哪些部落格?–Windows Store App 相關網路資源分享

首先,Windows Store App 在 Facebook 有中文討論社團喔! 這裡提供了互相討論的自由空間,同時也能即時獲得免費課程、最新技術變化等資訊,歡迎已在開發或有興趣接觸的夥伴加入: https://www.facebook.com/groups/331827086897287/ 

image

   

中文部落格:

– .Net 海角點部落– 人稱 Bill 淑,MVP,也是 Windows Store App 獲利模式探討的主講人,同時亦專精於 Windows Phone App 開發。

– 開發者之魂– 人稱上官神人,在 Windows Azure, Windows Store App 及 Windows Phone App 皆有專精,如精通 Windows Store App / Windows Phone App 的 ListView / ListBox 控制項。

– Blogs of Han– 作者目前任職於中國微軟,已集結許多較具深度的文章,如Windows 8.1下ListView和GridView的数据分步显示 & 在MVVM架构下实现将基于ListViewBase控件的显示项滚动到可视范围内(Windows 8.1)。

– Windows Store apps development support– 作者亦任職於中國微軟,好文如 如何正确使用Background Task的几点建议 & How to use new controls in Windows 8.1。

– Mr.BIG– 曾擔任微軟學生大使,同時在 「2012 Windows 開發嘉年華」比賽中勇奪冠軍的優秀學生,如果想快速了解 Windows 8.1 的新功能,他的兩篇文章可以作為快速的入門: 初探WINDOWS RUNTIME FOR WINDOWS 8.1 & XAML FOR WINDOWS 8.1的求新求變。

– Frank– 還是個學生喔! 但已成功發佈許多 Windows Store Apps 在市集上了,文章教學性高,同時也非常勤於分享,代表文章如: [Windows 8 App]上架流程全紀錄。

– 科技來自於人性– 同樣還是個學生! 已有許多 Windows Store 相關文章,著重在開發上的小技巧及發現,如 Windows 8.1 拍照與攝影—CameraCaptureUI 類別。

– 亂亂寫 Blog– 文章著重在開發工具 (Visual Studio)、開發流程控管及企業導入,文章 Native Web App 的登入三兩事…討論在 WebView 中確保登入狀態的方法,是企業實作 App 時很常見的情況。

– 小朱® 的技術隨手寫– Windows Azure 大師,可深入了解在 Windows Store App 中使用微軟雲端運算。

– 黃忠成– 微軟專業講師及 MVP,Tech Days 2013 – Azure Mobile Services 及 MSDN – Windows 8 非同步開發。

– No.18 – 「HTML5 & JavaScript程式開發實戰」的共同作者,JavaScript/WebAPI 高手,文章如: HTML5 & JavaScript New Feature In Windows 8.1。

– Bruce Chen– 於台灣微軟擔任企業技術支援,有如何使用 Live SDK 的文章。

 

英文部落格:

– Windows App Builder Blog: 微軟官方部落格,主要在重要訊息的發佈,如 BUILD 2014 將於 2014/4/2~4/4 舉行。

– Project Siena– Siena 是微軟官方開發出來的 App,可以讓非開發人員拖拖拉拉即作出自己的 Windows Store App: Project Siena: 非開發者也能打造 Windows 8.1 App。

– Ibrahim KIVANC – DPE Technical Evangelist: 有 Windows 8.1 App 開發的一系列教學文。

– Jerry Nixon– 常常會出現許多有趣的範例及文章,如讓你的 XAML 下雪 Make it snow with XAML 及處理平版轉向的兩個方法: The two ways to handle orientation in your Windows 8.1 app。

– Windows Store Developer Solutions– 是個共筆 blog, 集結了許多微軟內部技術人員的文章,比如 Ten Things You Need to Know About WebView (雖然Windows 8.1 在 WebView 上已作了許多改變) 及 Accessibility Gotchas 1: Xaml ListView speaks in tongues。

– Jeremy Likness’ Blog– 有許多 AngularJs 及 Windows Store App 等相關文章。

中文教學影片:

– Channel9 Taiwan 第九頻道– 包含開發工具、Web Design、Windows Azure、Windows Phone 及 Windows Store App 等中文影片。

Unity3D 轉成 Windows Phone App 或 Windows Store App:

– 在 Untiy 的官網中有4份 PDF 文件 (http://unity3d.com/pages/windows/porting),若您要 porting Unity Games 至 Windows 平台的話的必讀! 

– 另,MVA 中也有課程 (英文): Porting Unity games to Windows 8.1 & Windows Phone

Smooth Streaming on Windows 8.1 App

Smooth Streaming 的技術,可以讓使用者在觀看影音內容時,能依據使用者當時的連線狀況,給予不同的解析度來播放,以達到觀看時的流暢性;比如使用者以 3G 上網或在網咖以極速連線時,Smooth Streaming 可以即時偵測網路頻寬,立即調整以較小或較大的 bit rate 來播放,減少出現 buffering 的等待機會。

若您已經採用了 Smooth Streaming 技術,要在 Windows 8.1 App 中播放是很容易的事,而且可以直接使用 MediaElement 物件來播放。

各位可下載以下程式碼作為連結 Smooth Streaming 的參考: http://sdrv.ms/1enKc40

您會需要: Microsoft PlayReady Client SDK for Windows 8.1 Store Apps, Microsoft Smooth Streaming Client SDK for Windows 8.1

有個公開的 Smooth Streaming 資料源可以讓大家作測試: Microsoft PlayReady (TM) Test Server

以下是幾個執行畫面:

image

全螢幕播放:

image

邀請使用者對你的 Windows Store App 評分 (App review & rating)

打開 App.xaml.cs 檔,先宣告以下兩個變數:

private DispatcherTimer m_DispatcherTime;
StorageFolder folder = ApplicationData.Current.LocalFolder; 

在 App() 中呼叫 loadInfo() 方法如以下:

public App()
{
      this.InitializeComponent();
      this.Suspending += OnSuspending;
      loadInfo();
}

最後實作 loadInfo(), m_DispatcherTime_Tick() 及 CommandInvokedHandler() 方法如以下:

private async void loadInfo()
{
    bool isExist = true;
    try
    {
        StorageFile isExistfile = await folder.GetFileAsync("isExist.dat");
    }
    catch (FileNotFoundException ex)
    {
        isExist = false;
    }
    if (!isExist)
    {
        m_DispatcherTime = new DispatcherTimer();
        m_DispatcherTime.Interval = new TimeSpan(0, 0, 0, 5);
        m_DispatcherTime.Tick += m_DispatcherTime_Tick;
        m_DispatcherTime.Start();
    }
}

#region rating timer

private async void m_DispatcherTime_Tick(object sender, object e)
{
    var dialog = new MessageDialog("請至市集給我們評份及建議。", "評分及建議");
    dialog.Commands.Add(new UICommand("Cancle", CommandInvokedHandler, 0));
    dialog.Commands.Add(new UICommand("Go", CommandInvokedHandler, 1));
    dialog.DefaultCommandIndex = 1;
    await dialog.ShowAsync(); m_DispatcherTime.Stop();
}

/// <summary>
/// Callback function for the invocation of the dialog commands.
/// </summary>
/// <param name="command">The command that was invoked.</param>
private async void CommandInvokedHandler(IUICommand command)
{
//Windows.System.Launcher.LaunchUriAsync(new Uri
//("ms-windows-store:REVIEW?PFN=Your package family name from the manifest"));
    if (command.Id.Equals(1))
    {
        StorageFile file = 
        await folder.CreateFileAsync("isExist.dat", 
        CreationCollisionOption.ReplaceExisting);
        Windows.System.Launcher.LaunchUriAsync
             (new Uri("ms-windows-store:REVIEW?PFN=
                9034Meng-RuTsai.OsakaMetroMapOffline_bygkn6mn9zr2y"));
    }
}
#endregion

黃色部份是 Windows Store App 的 family name (套件家族名稱), 可以在 manifest 檔中取得:

image

其實,邀請使用者至市集評分頁的關鍵之處,是使用 Windows 作業系統預設的 Protocol Activation。各位可以將以下直接貼在瀏覽器中作試驗。

ms-windows-store:REVIEW?PFN=9034Meng-RuTsai.OsakaMetroMapOffline_bygkn6mn9zr2y

最後,以上程式是以利用一個暫存檔 (isExist.dat) 來判斷是否要提醒使用者,此檔建立在使用者目錄下的 AppData 資料夾中,如:

C:Users[user name]AppDataLocalPackages972A5D21.43908557F4F45_tkaddggce39qpLocalState

如果想重覆測試,删掉 isExist.dat 檔即可。此檔記錄使用者是否有點擊 Go 的選項。

以下是執行畫面供參考:

image

使用者點擊 Go 的話:

image

[新聞] 現在要上架 Apps 到 Windows Store 上變得更便宜了!

自即日起,申請上架 Windows Store 的「個人帳戶」年費已由原來的台幣 NT$1,420元 ($49 美元) 降價至台幣 NT$568元 ($19 美元) 了! 「公司帳戶」則仍維持台幣 NT$2,840 ($99 美金)。

其實這篇新聞的最大重點,是 Windows Phone 及 Windows Store 兩個市集的註冊程序已經合併了,也就是只要註冊一次,開發者即可以選擇將您的 Apps 上架至 Windows Phone 或 Windows Store 市集。簡略說明重點如下:

  • 已註冊的 Windows Phone 開發者: 現在可以使用既有的 Microsoft Account,免費提交 Apps 到 Windows Store 市集。

  • 已註冊的 Windows Store 開發者:現在可以使用既有的 Microsoft Account,免費提交 Apps 到 Windows Phone 市集。

  • 新的開發者、或是既有的開發者:可以使用同一個 Microsoft Account 註冊或續訂。開發人員只要提交一次註冊資訊,選擇支付 「個人帳戶」$19美元或「公司帳戶」 $99 美元的年費,即能同時發佈 Apps 於 Windows 和 Windows Phone 的市集中。

  • 已使用相同的 Microsoft Account 同時在 Windows Store 和 Windows Phone 註冊的開發人員: 本月將收到一組代碼,免費獲得延長一年的續簽優惠。

  • 學生身份開發者可持續獲得 DreamSpark 計畫的註冊優惠。

現在就將您的 Apps 發佈至 Windows Phone 及 Windows Store 平台,獲得大獎機會!

App 怪獸爭霸戰第二回合即將在 2013/11/15 展開,Apps 愈多得獎機會愈大喔!

https://aka.ms/appbattle

image

2013/11月 Windows 相關免費講座、研討會一覽

時間

地點

講題

報名方式

2013/11/06 (三)下午15:30~17:00

世新大學「大文山App園區」

新北市新店區復興路45號7樓

「Windows 8.1 App、Windows Phone App開發及Windows Azure簡介 」

直接來現場即可

2013/11/9 (六)9:30 ~ 17:30

台北市復興南路一段390號3樓 301 (資策會)

App遊戲開發實作 – 跨平台就這麼簡單 Unity x Windows

有參加條件,詳情請見: http://www.accupass.com/go/unitywp

2013/11/14 (四)14:00 ~ 17:00

台灣微軟 7B 會議室 (台北市信義區松仁路 7 號 7 樓)

Windows 8.1 新 API 介紹 + 透過 Windows Store App 獲利!實作及分享

報名網站:

http://msdn.microsoft.com/zh-tw/windows/dn458957.aspx