[教學] 製作Resumable XAP for WP7,加強多工處理效率

本帖最後由 木馬_06619 於 2011-6-27 17:59 編輯

Resumable XAP tool原作者的網站:
http://windowsphonehacker.com/resumablexap
內有影片和英文說明。

妙問:何以需要製作Resumable XAP?
妙答:目的是為了加強WP7的多工處理效率,方便自己的應用。
(不過,後來的官方Mango更新也會支援多工呢!)

【運作效果展示】
http://www.youtube.com/watch?v=P7rgGM-p5q4&feature=player_embedded

原作者說:
In every WMAppManifest.xml file, located inside the XAPs, there's a line called "DefaultTask". In the Visual Studio IDE, there's little you can do with this line, but if you edit it post-compiling, you can actually do a lot of things. In this case, adding the term ActivationPolicy="Resume" to your DefaultTask will make the application resume the task, rather than replace it (default action).


簡單來說,即是為每個軟體內的WMAppManifest.xml加入一個指令來達成Resume,避免每次打開軟體的時候都需要重新載入,節省些許時間。

首先,我們需要一部已解鎖的WP7手機,用USB接線連接電腦,並讓Zune一直開啟,而手機亦不能處於鎖屏狀態。
然後我們需要另外兩個電腦軟體:

一、WP7 Desktop Marketplace
下載網址http://forum.xda-developers.com/showthread.php?t=908293
用來搜尋並下載Marketplace上的軟體,並儲存成.xap檔案。

二、resumable XAP tool
下載網址http://windowsphonehacker.com/files/resumablexapbeta.zip
用來將已儲存的.xap檔案修改成resumable,並將其載入已解鎖的WP7手機

我亦把操作步驟製作成影片,可以到以下youtube網址觀看,過程相當簡單。
http://www.youtube.com/watch?v=k2ZUq3MM7oI

除此以外,還需使用早前的Dehydration hack(http://windowsphonehacker.com/dehydrationhack)來實行Instant Resume,以Resumable XAP配合Dehydration hack的效果更為顯著。不過這種修改亦不是萬能的,在某些軟體上不會展現任何效果,如官方的Facbook軟體。敢於嘗試的我為自己的手機載入了幾個resumable xap,如FIM Facebook Chat、Messenger by Miyowa、gTasks、Twitter、gReadr,非常實用,使人滿意。在Mango到來前,借以上方法來先嚐一口multi task的滋味。