【Advanced Windows Phone Programming】番外篇 WP8與WP7


本來計划中是沒有此番外篇的,但是序章里大家的評論讓我意識到,鑒於微軟歷來對開發者的“冷酷無情”,以及WP8中種種新特性的欲語還休,讓很多持觀望態度的開發者們很迷惑,此番外篇的目的是根據微軟提供的合作伙伴SDK文檔來給大家解釋一下目前常提出的幾個困惑,鑒於各種協議和規定,請大家不要向我索要文檔,如果有疑問,請在盡量留言中提問,或者聯系QQ:624709714,但是由於文檔比較初期,很多內容也是草草帶過,我會盡我所能回答大家,如有變動,請以微軟正式公布的SDK documentation為准。

1.WP8和WP7的內核不一樣么?

   是的,WP7采用的是CE的內核,WP8采用的是NT內核。

2.WP8的分辨率支持多種么?

 
 

Resolution

Aspect ratio

Scaled resolution

WVGA

480×800

15:9

480×800

WXGA

768×1280

15:9

480×800

720P

720×1280

16:9

480×853

3.WP8支持程序內支付么?

支持,

In-app purchasing

In-app purchasing gives developers the ability to create apps or games that sell virtual products for real money. Microsoft servers host the catalog products that are available for in-app purchasing, including price and descriptive metadata. Microsoft also provides a commerce infrastructure, including methods for users to pay in 190 regions around the world.

 

For each product that users can purchases through in-app purchasing, a developer enters a description in Dev Center, in addition to prices for each region where users can make the in-app purchase. Using the APIs in Windows Phone 8, a developer can list, within an app, the products that are available to purchase in that app. Developers do not need to write special code for handling different types of purchase instruments. All purchase methods that users can use to purchase apps and games are supported for in-app purchasing. The app or game must host and deliver any content associated with the in-app product

4.WP8架構支持了C++么,C#會被邊緣化么?

這個答案就仁者見仁智者見智了

首先我們來看一下WP8的系統架構

大家還記得WIN8的新API封裝WINRT么,沒錯,Wp8采用的是NT-based kernel,所以自然會享受WINRT帶來的便利,不過在WP8中,采用的是WINRT的一個特殊版本:WINPRT

以下是微軟對於為什么支持了Native C++的解釋

Microsoft recognizes that the lack of native support on Windows Phone has been a blocker for many developers who have existing applications and games on other platforms, and with the addition of native development support, Windows Phone 8 reduces the need to port and maintain components such as compute engines, graphic libraries, and API sets.

相信這個理由也和大家之前所猜測的一樣。

而微軟支持C++的一個主要原因,也是為了降低原生Directx游戲的移植難度,那么WP8對directx的支持如何呢?

首先WP8只支持D3D而不支持D2D。

其次WP8只支持到level 9_3,定點着色器模型只支持到2.0。

目前微軟的開發模板只支持如下幾種

1.純Metro開發,即C#/C++為主要語言開發metro程序,跟WP7一樣

2.純DirectX開發,即只支持C++開發3D游戲

3.混合開發,即使用C#/VB等語言開發UI等界面,C++調用D3D來繪制單一頁面以獲得更好的效率,類似於WP7的Silverlight+XNA混合開發。

由此可見,C++在wp8上並不是靈丹妙葯,除非是移植現有程序或制作跨平台的通用庫,如音頻、視頻、網絡等,或者移植已有應用或游戲,才會使用C++為首選,而且從Win8里那個不倫不類的C++/CX來看,C++在WP8上也難逃被擴展的命運,所以現在使用C#開發應用的同學完全沒有必要擔心,而使用XNA開發游戲的同學如果不想移植到WIN8也沒有必要擔心,畢竟XNA的開發效率可能會更高一些,當然程序運行效率也不會比D3D差太多。

由此可見,講WP7開發所累積的經驗可以直接應用到WP8中,所以大家完全沒有必要擔心現在所學的WP7知識是浪費時間。

所以本系列的名稱是WINDOWS PHONE PROGRAMMING 而不是 WP7 PROGRAMMING.


大家需要做的只需稍安勿躁,累積開發思想,以不變應萬變即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM