2013年4月13日 星期六

建立Windows Phone 7平台的PhoneGap專案

要建立Windows Phone 7的PhoneGap專案很容易,步驟如下:

1. 下載並安裝Windows Phone SDK 7.1Windows Phone SDK update for Windows Phone 7.8(為什麼不選擇Windows Phone SDK 8.0?因為8.0的Visual Studio 2012需在Windows 8 64-bit上運行,而Windows Phone 8模擬器甚至指定要Windows 8專業版以上才能相容......):




2. 下載最新版的PhoneGap

3. 解壓縮PhoneGap,從phonegap-x.x.0\lib\windows-phone-7資料夾內找到CordovaWP7_x_x_0_StandAlone.zip和CordovaWP7_x_x_0_Full.zip:

4. 將CordovaWP7_x_x_0_StandAlone.zip和CordovaWP7_x_x_0_Full.zip複製到我的文件/Visual Studio 2010\Templates\ProjectTemplates資料夾內:

5. 開啟Visual Studio 2010 for Windows Phone,檔案 -> 新增專案,應該可看到多了兩個專案選擇,CordovaWP7_x_x_0_StandAlone和CordovaWP7_x_x_0_Full,前者維持原始碼,後者將原始碼包裝成dll檔。就看大家喜歡哪一個,我個人都選擇前者,因為可以修改原始碼畢竟比較有彈性:


6. 開啟後等待部屬,部屬完畢後即可開模擬器或連接手機執行:


7. 最後再添入我們自訂的內容到index.html即可。

沒有留言:

張貼留言