【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.


大家需要做的只需稍安勿躁,累积开发思想,以不变应万变即可。

posted @ 2012-06-25 01:15  SandCu  阅读(2516)  评论(9编辑  收藏  举报