邀請使用者對你的 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 檔中取得:
其實,邀請使用者至市集評分頁的關鍵之處,是使用 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 的選項。
以下是執行畫面供參考:
使用者點擊 Go 的話:
[新聞] 現在要上架 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
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 |
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 獲利!實作及分享 |
報名網站: |
[Unity] 開發 Windows Store App 相關資源整理
[你需要什麼?]
Windows 8 或以上版本:
– Free 90 days eval, or
– 若符合學生資格或成立五年以下新創公司,可分別透過 DreamSpark 或 BizSpark 取得免費高階版本
– MSDN 訂戶可免費下載
Unity 4.2 或以上版本:
– Free 30 days trial (Pro included)
Visual Studio 2012 或以上版本:
– Free Express version, or
– 若符合學生資格或成立五年以下新創公司,可分別透過 DreamSpark 或 BizSpark 取得免費高階版本
– MSDN 訂戶可免費下載
Windows 市集開發人員帳戶 (上架 Windows Store 時需要)
– 開立 Windows 市集開發人員帳戶 (個人帳戶: US$19,公司帳戶: US$99), or
– 若符合學生資格或成立五年以下新創公司,可分別透過 DreamSpark 或 BizSpark 取得一年免費帳戶
– MSDN 訂戶亦有一年免費帳戶
[有正式文件或線上資源可參考嗎?]
– Unity3D/Microsoft 的官方文件請見 Porting tips for Windows Store (813 KB)
– 線上課程 (英文) Porting Unity games to Windows 8.1 & Windows Phone 中的 Module 2~3 特別討論到注意事項及 Duel Runtime environment ,建議一聽。
[開發 Windows Store 或 Windows Phone App 的流程?]
可以簡單分為三步驟:
其中與 iOS 最大的不同是第二點,也就是需要透過 Visual Studio 2012 或以上的版本來進行編繹。
Unity 專案在 “Build And Run” 之後會產生一個完整的 Visual Studio solution,其中的 .sln 檔可以用 Visual Studio 開啟。
開發者可以直接編譯成可上傳 Store 的 packages,或是透過 Visual Studio 進行進一步的修改。
Visual Studio 提供完整的模擬器進行測試,不一定要將 App 裝在實體機器上測試。
[我遇到 “error CS0103: The name ‘xxxx’ does not exist in the current context”]
其中的 ‘xxxx’ 可能是 File, FileStream, HashTable, Dictionary 等等。解法及原因說明請參考 [Unity Game to Windows Store] Compile error- missing namespaces/classes (中文)
[我遇到 DEP0700 編譯錯誤怎麼辦?]
錯誤訊息為:
Error: DEP0700: Registration of the app failed. Windows cannot install package “你的專案名” because the package requires architecture ARM, but this computer has architecture x64 (0x80073cf3).
其原因是 Unity 預設將它的 package 包成可在 ARM, x86 及 x64 不同平台執行的版本,而您的 Visual Studio 顯然並不是在 ARM 機器上跑的,所以會產生這個錯誤。
解決方法是,至 Visual Studio 的 Build –> Configuration Manager 中選擇 x86 即可。
[我可以在 Visual Studio 上 debug 嗎?]
目前支援對 C# scripts 作偵錯。詳細步驟請見: http://docs.unity3d.com/Documentation/Manual/windowsstore-debugging.html
[那我是用 JavaScript 或 Boo 怎麼辦?]
這是許多既有 Unity 專案會遇到的問題,各位可參考這篇文章Creating a Unity Game for Windows 8中的留言,也就是可以善加使用 ILSpy (http://ilspy.net/) 這個工具。
“The major challenge for existing apps is porting the code from JavaScript to C#. Most of the examples and existing code base (plugin’s etc.) are JavaScript. However there is a very good and free tool called ILSpy that will examine the compiled assembly and decompile it into C#. Private variables will lose their names, some of the code will be hard to read, however it does work and in about 1-3 hours of work you should be able to port your existing Unity Android/iOS game to Windows Phone or Store. This is by far easier than writing a new game in Visual Studio.
Of course the reverse is also true, write your game in Unity for WP8 or W8 and easily (in minutes) port it over to Android iOS”
[有支援我常用的 Plug-ins 嗎?]
以很受歡迎的 Prime31 為例,目前已有 Windows 8 及 Windows Phone 8 的版本,可以持續使用。
[可以教我怎麼註冊 Windows Store 及 Windows Phone 市集嗎? ]
以下兩份文件包含註冊以及上架你的 App 的詳細步驟,以及可能遇到的問題說明:
[其他]
Unity 官方網站亦整理了許多 Windows Store 及 Windows Phone 8 的 FAQ 等相關文件如以下:
- Windows Store: Getting Started
- Windows Store: Deployment
- Windows Store: Debugging
- Windows Store: Profiler
- Windows Store : Command line arguments
- Windows Store : Plugins
- Windows Store : Project Types
- Windows Store : FAQ
- windowsstore-examples
- Windows Phone 8: Getting Started
- Windows Phone 8: Deployment
- Windows Phone 8: Debugging
- Windows Phone 8: Profiler
- Interaction between Unity and Windows Phone step by step guide
- Windows Phone 8: Plugins
- Windows Phone Plugins step by step guide (using C#)
- Windows Phone Plugins step by step guide (using C++)
- Windows Phone 8: FAQ
- wp8-examples
延伸閱讀: 我的第一個 Unity3D Windows Store App
(Last update: 2014/1/17)
Windows 8.1 上市之後,我還能繼續開發 Windows 8 App 嗎?
答案是可以的! 您可以繼續使用 Visual Studio 2012 開發且上架 Win8 App,或是使用 Visual Studio 2013 開發 Win8.1 後上架;最棒的是,Visual Studio 2012 及 Visual Studio 2013 是可以同時安裝在 Windows 8.1 上的!
至於 Win8 App 及 Win8.1 App 在不同版本作業系統上之相容性如何呢? 請見下表:
也就是所有的 Win8 Apps,都能直接在 Win8 及 Win8.1 機器的市集中下載並且順利運行;然而 Win8.1 Apps ,則只能運行在 Win8.1 的機器上。
以這樣的角度看來,繼續開發 Win 8 App 以能同時在 Win8 及 Win8.1 的機器上運行,就會是很明智的作法,因為雖然2013/10/18起,所有的 Windows 8 就可以免費經由 Windows Store 升級為 Windows 8.1,但在這完全轉移的過程中, Win8 Apps 能同時讓最多的使用者有機會下載使用。
那是不是就沒有開發 Win8.1 Apps 的理由了呢? 有兩點考量給各位參考。
第一,就是 Win8 App 在不更改程式碼的情況,只要重新 compile 成 Win8.1 App,在效能上就會有很大進步:
第二,當然就是 Win8.1 加強或新增的 APIs 了。下表可以看到這些改變:
以上這些改變中,綜合過往一年來 Win8 App 開發合作夥伴的反應,前 3 名最有感的改變是:
1. WebView 控制項: 現在可以直接存取本地 Web 內容,甚至執行其中的 JavaScript 了! (範例: http://code.msdn.microsoft.com/XAML-WebView-control-sample-58ad63f7)
2. 利用全新的 RenderTargetBitmap 物件,就可以將整個 UIElement (如: Gird) 存成圖檔,以作出如 Instagram, Instaweather 等效果: (說明: http://msdn.microsoft.com/zh-tw/library/windows/apps/bg182878.aspx)
3. 終於內建支援 PDF rendering,再也不用花錢購買第三方軟體套件了! (中文詳解: 在Windows 8.1 App中輕鬆完成PDF渲染)
小結: 在 Windows 8.1 上市之後,要開發一個 Windows Store App ,可以有以下 3 種選擇:
A. 僅作成 Win8 App: 優點是可在 Win8/8.1 機器中看到,但效能會較差且無法使用 8.1 新增 APIs.
B. 僅開發 Win8.1 App: 可使用 8.1 APIs 且在效能有進步,但無法在 Win8 機器中運行。
C. 同時開發 Win8及8.1的版本: 可使用新功能且效能好,又可同時在 Win8/8.1 機器上運行 (但增加維護成本)
未來的 Windows Store 的上傳畫面,也因這些可能的選擇而作了改變,以下是 packages 上傳畫面:
相同的 App 在 Win8/8.1 的資訊填寫畫面:
延伸閱讀: Windows 8.1 Preview:開發人員適用的新 API 和功能
繼 Unity 之後,Cocos2d-x 也正式支援 Windows 8 及 Windows Phone App 了!
Cocos2d 也是一個廣為許多遊戲開發者使用的遊戲引擎,在這個版本中除了開始支援 Windows Store App 及 Windows Phone App 之外,也將支援第一個穩定的 CocoStudio v1.0 版本:
來源: http://www.cocos2d-x.org/wiki/Release_Notes_for_Cocos2d-x_v22
下載 cocos2d-x-2.2.0.zip
相關內容: 我的第一個 Unity3D Windows Store App
我的第一個 Unity3D Windows Store App
Unity 自4.2版起即開始正式支援 Windows Store App 及 Windows Phone 8,而且這兩個 add-ons 不但在 Unity Pro 上是免費的,同時在free version 的 Unity 上也是內建的免費功能!
========================= 分隔線 =========================
以下我即以 free version 的 Unity,一步一步建制一個簡單 Windows Store App 讓大家參考。
首先在 Unity 中新增專案,不要匯入任何的packages。
先在 Hierarchy 中建立一個 Cube,
然後在 Inspector 中改變其 Rotation 及 Scale 如以下:
現在這個 Cube 看起來是黑黑的一團,所以我們加點光給它: 到 Hierarchy 中建立一個 Directional Light:
接下來我們寫一行 C# code 讓這個 Cube 會轉。先到 Hierarchy 中選擇 Cube 物件後,在其 Inspector 畫面中往下拉,選 Add Component –> New Script –> CSharp 後,按下 Create and Add:
這時在 Project 中的 Assets 中會出現剛建立好的 C# script:
雙點這個 script 會開啟 MonoDevelop 來編輯, 在 Update() 方法中加一行:
// Update is called once per frame
void Update () {
transform.Rotate(Vector3.up, Time.fixedDeltaTime * 200.0f);
}
存檔後回到 Unity,按下上方的 Play 符號就會看到 Cube 旋轉的樣子。
接下來我們想在旋轉的 Cube 上新增一些花樣: 至 Project 的 Assets 中按右鍵: Import Packages –> Particles, 然後直接按 import
完成後點開 Assets –> Standard Assets –> Particles,然後選擇 Smoke,把 Fluffy Smoke 拖拉到 Hierarchy 下,就會看到 Cube 在冒煙。
如以上步驟,再選擇 Fire 後,把 Flame 拖拉到 Hierarchy 下,就會看到 Cube 冒出火來;你也可以 Play 看看效果。
接下來,要把它建制成 Windows Store App了!
在 File –> Build Settings…中,選擇 Windows Store App –> XAML C# Solution,然後 Build And Run 後即可。
建制完畢後會在資料夾中看到完整的 Windows Store App solution:
我們以 Visual Studio 2012 開啟 .sln 檔,若直接編譯的話會看到以下錯誤:
錯誤訊息為:
Error: DEP0700: Registration of the app failed. Windows cannot install package “你的專案名” because the package requires architecture ARM, but this computer has architecture x64 (0x80073cf3).
其原因是 Unity 預設將它的 package 包成可在 ARM, x86 及 x64 不同平台執行的版本,而您的 Visual Studio 顯然並不是在 ARM 機器上跑的,所以會產生這個錯誤。
解決方法是,至 Visual Studio 的 Build –> Configuration Manager 中選擇 x86 即可。
這是順利執行之後的預設 splash screen:
跑起來的樣子如下
延伸閱讀: 繼 Unity 之後,Cocos2d-x 也正式支援 Windows 8 及 Windows Phone App 了!
Visual Studio 2013 台灣發表會上demo的Windows Store App
這個 Windows Store App 是連結了 Eric 上一場 Demo 建立出來的Web API (JSON格式),將現場人員的留言撈出來的小範例。
程式碼下載: http://sdrv.ms/18oi37y
程式碼的部份很簡單,撈取 JSON URI 資料後存為 JsonArray,以 for 迴圈填入 ListView 即可:
private async Task GetJSON()
{
try
{
progressRing.IsActive = true;
listView.Items.Clear();
string strURI = "http://twvs2013launch.azurewebsites.net/api/message";
var http = new HttpClient();
var response = await http.GetStringAsync(new Uri(strURI));
jsonValue = JsonValue.Parse(response.ToString());
jsonArray = jsonValue.GetArray();
arraySize = jsonArray.Count;
this.listArray = new string[arraySize];
textBox.Text = arraySize.ToString();
for (i = arraySize – 1; i >= 0; i–)
{






