游戏邦在:
杂志专栏:
gamerboom.com订阅到鲜果订阅到抓虾google reader订阅到有道订阅到QQ邮箱订阅到帮看

跨平台工具能否终结手机平台大战?

发布时间:2011-12-12 18:10:12 Tags:,,,,

作者:Jonas Lind

虽然有不少市场调查数据认为,手机应用市场、智能手机市场已形成苹果App Store和谷歌Android Market两家独大的局面,但在移动网页及跨平台工具领域,其垄断优势或许将遭遇移动网页及跨平台开发工具的挑战。HTML5支持所有平台通过浏览器提供应用,VisionMobile今年的开发者经济报告也显示,移动网页(HTML5是其子类)已成为除了Android、iOS之外的第三大开发者选择平台。

Platform X(from visionmobile)

Platform X(from visionmobile)

当然,HTML5能否取代原生应用这种说法仍然有待考证。比起基于HTML5的应用,原生应用可提供更丰富的功能、更出色的性能,更高级的安全设置。quirksmode.org的调查报告显示,每个移动WebKit的实现方式都略有不同,而这会影响HTML5应用的运行效果。Netbiscuits最近的白皮书报告统计,智能手机支持18种HTML5功能,主流智能手机仅部分支持(或者不支持)这些功能。除此之外,HTML5在执行过程中也存在平台分裂性。适用于iPhone平台的功能未必支持运行于RIM或者三星设备,反之亦然。Forrester则针对HTML5 vs.原生应用的论战点评道,“关于‘原生应用 vs 网络’的争论仍然没有多大意义,这不是非此即彼的问题,而是两者都无法取舍的问题”。

跨平台开发工具

新型跨平台工具比普通的HTML5而易令人产生兴趣,因为它们可提供比基于HTML5的浏览器更高级的运行性能和功能。这些开发应用的工具可归为两类:

1)网页应用/混合应用。这些应用基于网页引擎(网页浏览器),一般是用HTML/CSS/JavaScript编写而成。

2)原生应用。这些应用可编译到机器代码,一般用C++或类似的语言编写。

跨平台工具还只是一个初级市场,其主导力量是近几年出现的一些初创企业。以下图表根据应用的复杂性和运行性能,反映跨平台工具市场所提供的不同解决方案。

cross platform(from visionmobile)

cross platform(from visionmobile)

传统网站:上图左下角就是传统网站,其表现性能有限,但却支持运行于所有平台,并且几乎没有任何复杂度。只要所有平台都支持HTML5技术标准,普通的HTML5应用就能植入这些浏览器。

网页应用/混合应用:HTML5网页应用可下载到浏览器的缓存中,并且能够在离线状态中运行。这类应用可展现更优良的运行性能,复杂度也并不是太高。再往上一阶层就是以原生形式运行的跨平台工具市场。这类工具的运行性能更佳,但如果要同时支持多个平台,其复杂度也会更高。这其中包括基于HTML5/CCS3和JavaScript编写的网页应用,此类应用添加了一些原生元素,通常会体现出原生应用的外观。这类跨平台工具通常还能访问移动设备的一些低端本地功能。这个市场领域的典型代表是PhoneGap,该服务常与Sencha Touch框架同时使用。其他可与PhoneGap的工具包括WorkLight和appMobi。

与该市场领域相邻的是混合工具,它们可将HTML5/JavaScript输入转换成真正的本地源代码。混合工具供应方的典型代表是Appcelerator旗下的Titanium。

其他网页/混合应用的解决方案主要基于Java、Lua、ActionScript或一些较不常见的语言。从图表中可以看出,尽管Java ME复杂度很高,但其应用表现性能却并不理想。Corona SDK和DragonRAD是基于Lua的跨平台工具。Rhodes是基于HTML/Ruby的工具,OpenPlug则以ActionScript(Flash)为源语言。Kony使用拖放式方法创建企业网页应用。目前尚无充分信息显示大多数此类工具的表现性能/复杂度如何,所以其排序位置仅供参照。通常来说,那些可将最终代码编译或重新编译成本地ARM机器代码的工具都有较良好的表现性能。

原生应用:第二个大类就是原生应用。在原生应用跨平台工具中,开发者一般选择C/C++或C#代码库(可半自动地移植到目标平台和设备)。其本地代码运行性能明显更出众,但复杂度也会更高。这个领域的主要代应供商包括Airplay、Qt和MoSync。Airplay SDK(现已更名为Marmalade)起源于3D游戏领域,但现在也可作为一般的C++跨平台工具。Qt是一个可支持本地C++移植的跨平台UI框架,主要支持诺基亚平台。MoSync主要用于C++开发环境的跨平台工具,可与Eclipse IDE兼容,同样可在开源授权条件下使用。

添加本地扩展包

传统的跨平台工具主要包括Java、Flash Lite和移动HTML。这些开发工具所展现的运行性能通常并不理想,其应对方案就是为其添加本地扩展包。可以向IDE添加额外的SDK/NDK库,同时支持其访问低端的硬件功能。开发者可通过设备数据库(它决定特定设备上可执行哪些条件式代码)让应用访问硬件功能。

有些跨平台工具供应商已经创建了拥有多种不同精细程度的设备数据库。设备数据库通常包含屏幕尺寸、输入形式、操作系统版本、硬件规格的相关细节、工作区中的已知漏洞等信息。

开发者使用本地扩展包,就有可能克服Java的一些内在局限性。与“一次性编写,运行于多个平台”的方法不同,开发者可将90%的时间用于开发一个通用代码库,然后用剩下的10%时间,根据各个平台和设备的特点,添加本地扩展包。对软件纯化论者来说,这种90:10的解决方案虽然并不算最高明,但却能够降低应用运行于多个平台的复杂度。开发者通过这种方法,就只需管理一个代码库,在不损害功能的前提下,将其移植到目标设备中。从原则上说,使用添加了扩展包的跨平台引擎开发的应用所展现的性能,应该会比直接针对目标设备开发的内容更为逊色。

结语

已有迹象表明,除了Android、iOS和Windows Phone 7等科技巨头推出的平台之外,QNX(RIM)、MeeGo(英特尔、中国移动)和Bada(三星)等操作系统的平台分裂现象将会消失。

需锁定整个市场用户的开发者正面临针对所有平台和设备开发产品的艰巨任务,假如他们能够使用跨平台引擎,其生产效率将大大超过逐个针对各平台开发内容。

较早采用跨平台工具的先行者将是那些需瞄准大众市场的消费者企业,例如传媒公司、游戏工作室、娱乐公司、银行以及所有需要开发B2C应用的品牌企业,政府机构也常需要向大众提供无差别的服务,它们也将成为跨平台工具的客户。另一部分较早接触跨平台工具的群体是大型企业家的首席信息官,因为其公司的高级员工需要使用智能手机访问公司内部数据。如果这些先行者们的需求成功促使跨平台应用产品价格下调,推动解决其中的技术稳定性问题,那么跨平台工具就有可能成为应用开发市场的主流。

假设更多开发者转向了跨平台工具,那么移动领域现有内容发布渠道的权力就会受到挑战。应用数量将不再是衡量主流平台及新兴平台影响力的重要标准,这样可以给小型平台创造更公平的竞争环境。

若C++跨平台引擎若能完全植入原生平台和设备扩展包,网页应用和HTML5也许成为传统平台最大的市场主导力量。届时原生应用开发者也许就会重新考虑是否要选择跨平台IDE,而非直接锁定Android、iOS和WP7。在这种情况下,跨平台IDE将成为与本地平台地位一样,甚至是更重要的竞争者,这也将彻底颠覆今天手机平台大战的格局。

游戏邦注:原文发表于2011年6月26日,所涉事件及数据以当时为准。(本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

Platform X: How cross-platform tools can end the OS warsJonas Lind Tweet this

[Are cross-platform tools a better solution than HTML5 to the challenges of platform fragmentation? Guest author Jonas Lind reviews the landscape of cross-platform tools and argues that such tools may become as important as the native platforms themselves.]

The Android vs. iOS vs. Windows Phone platform battle has been the talk of the industry for the last year. But the market share battle between handset platforms might not be as critical for the industry as many believe.

A popular view in the industry is that the market is inevitably moving towards an Apple-Google duopoly. Apple’s app store has more than 400,000 apps. Android is growing quickly from a base of more than 250,000 apps and is predicted to catch up with Apple later this year. Nearly 80 percent of all apps in app stores are controlled by these two market giants according to Distimo. Figures for Q1 2011 from Gartner show that the market share in the smartphone market for iOS and Android combined is 53 percent and rising.

But the duopoly may be challenged by the mobile web and cross-platform tools. HTML5 empowers all other platforms to offer apps through the browser. VisionMobile’s recent Developer Economics report shows that the mobile web (of which HTML5 is a subset) is already the third most popular platform in terms of developer mindshare after Android and iOS.

At the same time, HTML5 is overhyped and the belief that HTML5 will replace almost all native apps is in need of a reality check. Native apps will still offer richer functionality, better performance, and higher security compared to HTML5-based apps. A study by quirksmode.org has shown that every mobile WebKit implementation is slightly different, which could cause a problem for HTML5-based apps. In a recent whitepaper, Netbiscuits measured smartphone support for 18 features in HTML5 and showed that leading smartphones only offer partial (or no) support for a significant number of these features. Implementation is also fragmented. What works on iPhone will probably not work on RIM or Samsung handsets and vice versa. Or to quote Forrester’s take on the HTML5 vs. native debate: “The ‘Apps vs. Internet’ Debate Will Continue…to be irrelevant.”, “it’s not a question of ‘either/or’ when it comes to a choice between apps vs. the mobile Web, but both.”

The Landscape Of Cross-Platform Development Tools

The new types of cross-platform tools are more interesting than plain HTML5 because they can deliver higher performance and functionality than browser based HTML5. These tools produce apps as output and fall roughly into two categories:

1) Web apps/hybrid apps. These apps exploit the web engine (“web browser”) and are typically written in HTML/CSS/JavaScript.

2) Native apps. These apps are compiled into machine code and often written in C++ or similar languages.

Cross-platform tools are a nascent market with a flurry of startup activity over the last few years. The following diagram illustrates different trade-offs between complexity and performance in the cross-platform tools market.

Traditional websites: In the lower left corner is the traditional website, limited in performance but providing access to all platforms with no added complexity. Plain HTML5 could be included here once all browsers support the standard.

Web apps/hybrid apps: Adjacent in the diagram are HTML5 web apps that can be downloaded to the browser’s cache and run offline. They will offer better performance and only slightly higher complexity. One step up in the diagram is a market segment of cross-platform tools running simulated native. These tools deliver better performance but the complexity is also higher if the tool has to support multiple platforms. Here we find tools that produce web apps built on HTML5/CCS3 and JavaScript, with some added native elements, typically inside a native wrapper. These cross-platform tools often add native extensions that provide access to some low level native functionality. An example of a player in this market segment is PhoneGap, which is often used in tandem with the Sencha Touch framework. Other tools that run on top of PhoneGap are WorkLight and appMobi.

A closely related market segment is hybrid tools, where the HTML5/JavaScript input is translated into actual native source code. An example of a hybrid tool vendor is Appcelerator’sTitanium.

Other types of solutions which fall under the main heading of web/hybrid apps are based on Java, Lua, ActionScript or less common languages. The diagram shows how the heavily-fragmented Java ME offers inferior performance in spite of high complexity. The cross-platform tools Corona SDK and DragonRAD are based on Lua. Rhodes is based on HTML/Ruby while OpenPlug uses ActionScript (Flash) as source language. Kony uses drag-n-drop for building enterprise web apps. There is no reliable information about the performance/complexity trade-off for most of these solutions, so their exact position in the diagram above should be viewed as illustrative. In general, tools in which the resulting code is compiled or recompiled to native ARM machine code will have a higher performance.

Native apps: The second main category is native apps. In cross-platform tools for native apps, developers often work with a codebase in C/C++ or C# which is then semi-automatically ported to the target platform and device. Performance is significantly higher with native code, but so is the complexity. Players in this sector include Airplay, Qt and MoSync. The Airplay SDK (now Marmalade) originates in 3D gaming but can also be used as a general C++ cross-platform tool. Qt is a cross-platform UI framework that also can be used for native C++ porting. Qt primarily supports Nokia’s legacy platforms. MoSync is a cross-platform tool for general purpose C++ development, integrated with the Eclipse IDE and also available under an open source (GPL) license.

Cross-Platform Beyond Java – Native Extensions

The traditional approach to cross-platform development has been a lowest common denominator one – much like that taken by Java, Flash Lite and mobile HTML. This approach sacrifices performance, UI pizzazz and access to specific device features.

A workaround is to add native extensions. These can provide additional SDK/NDK libraries for the IDE and also give access to low level hardware functionality. Access to low-level hardware functionality can be managed by a device database that controls which conditional code will be executed on a given device.

Several of the cross-platform vendors have built such device databases with various levels of detail. A device database contains information on screen size, input modality and exact OS version, extending to detailed hardware configurations and known bugs with workarounds.

Using native extensions, it is possible to overcome the inherent limitations that plagued Java. Instead of “write once, run everywhere”, developers can spend 90 percent of their time developing a common codebase and 10 percent adding native tweaks and extensions for each platform and device. For software purists, the 90/10 solution might not seem very elegant, but it is a way forward that can handle the incredible complexity with thousands of devices running more than five OS platforms. In this way, app developers can manage one codebase and port it to target devices without losing functionality. In principle, using a (C++) cross-platform engine with extensions should be able to offer similar functionality with minimal performance penalty as compared to direct development for the target device. There will be significant economies of scale when the common codebase is tweaked for 100s of devices.

The Disruptive Potential Of Cross-Platform

There are few signs that platform fragmentation will disappear. It’s not just Android, iOS and Windows Phone 7, which are backed by corporate giants with deep pockets, but also smaller players like QNX (RIM), WebOS (HP), MeeGo (Intel, China Mobile) and Bada (Samsung). Add to that legacy platforms, which will be around for at least a few years: Windows Mobile, Blackberry OS, Symbian, BREW, Java ME and Flash. If we also include the main desktop platforms (Windows, Mac OS, Ubuntu), gaming consoles, set-top boxes, cars, and other gadgets, the number of platforms becomes unmanageable.

App developers whose clients need to reach the entire market, face the formidable task of supporting all platforms and devices. If they can use a cross-platform engine the productivity gains will be dramatic compared to paying for separate in-house dev teams for each platform.

Early adopters of cross-platform will most likely be large consumer businesses who need to target the mass market such as media companies, games houses, entertainment companies, banks, and any brand developing B2C apps. Similarly, government agencies are often required to provide non-discriminatory access to their services and cross-platform tools will enable them to do just that. Another group of early adopters of cross-platform tools is CIOs of larger corporations. They face increasing demand from senior staff who want to use their favorite smartphone for secure access of internal company data. Once these early adopters have driven down the prices and sorted out stability issues we should expect to see a fast uptake of cross-platform tools in the mainstream app development market.

Assuming more developers move to cross-platform tools, the power distribution in the mobile sector will be challenged. The difference in the number of available apps between dominant and up-n-coming platforms will be reduced. This will allow smaller platforms to compete on a level playing field.

Web apps and HTML5 should make the largest dent in the market power of traditional platforms. But the final nail in the coffin will come when C++ cross-platform engines can offer almost the same performance and functionality as coding directly on the target platform. This is possible if the cross-platform engines can fully integrate native platform and device extensions. In that case, developers of native apps might reconsider Android, iOS and WP7 and choose to code to a cross-platform IDE, not to the platform. In this scenario, the cross-platform IDEs would become players of equal or even greater importance than the native platforms. At the very least, today’s OS platform wars will move to a totally different level.(source:visionmobile


上一篇:

下一篇: