Xamarin 2.0 对比 Appcelerator Titanium 对比 PhoneGap [英] Xamarin 2.0 vs Appcelerator Titanium vs PhoneGap

查看:29
本文介绍了Xamarin 2.0 对比 Appcelerator Titanium 对比 PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在今年的所有 IDE 演进(所有平台都改变了)之后,我希望了解这些平台的技术状态.

After all IDE evolutions (all platforms on topic are changed) of this year, i'm looking to understand what is the state of technology for those platforms.

每个人的优点和缺点是什么?其中一种方法有一些局限性吗?

What are strengths and weaknesses of each ones? There are some limitations of one of those approach?

我在 C# 和 Javascript 方面有很好的经验,没有任何编程语言的影响会偏向一侧.

I have a good experience on C# and Javascript, than there are no programmatic language influence that could lean to one side.

推荐答案

概述

蒂姆·安德森

跨平台开发是一件大事,并且会一直如此,直到有一天所有人都使用同一个平台.安卓?HTML?网页套件?IOS?视窗?沙马林?钛?电话鸿沟?电晕?埃克.

Cross-platform development is a big deal, and will continue to be so until a day comes when everyone uses the same platform. Android? HTML? WebKit? iOS? Windows? Xamarin? Titanum? PhoneGap? Corona? ecc.

有时我听到有人说基本上有两种方法到跨平台的移动应用程序.您可以使用一个嵌入式浏览器控件并编写一个包装为本机应用程序的网络应用程序,如在 Adob​​e PhoneGap/Cordova 或 Sencha 采用的类似方法中,或您可以使用一个跨平台工具创建原生应用,例如 Xamarin Studio、Appcelerator Titanium 或 Embarcardero火猴.

Sometimes I hear it said that there are essentially two approaches to cross-platform mobile apps. You can either use an embedded browser control and write a web app wrapped as a native app, as in Adobe PhoneGap/Cordova or the similar approach taken by Sencha, or you can use a cross-platform tool that creates native apps, such as Xamarin Studio, Appcelerator Titanium, or Embarcardero FireMonkey.

不过,在第二类中,存在多样性.特别是,它们在抽象用户的程度方面有所不同界面.

Within the second category though, there is diversity. In particular, they vary concerning the extent to which they abstract the user interface.

这是权衡.如果你设计你的跨平台框架,你可以让您的应用程序在每个平台上以几乎相同的方式工作.如果您要跨所有平台共享 UI 设计,则很难让您的设计在所有情况下都同样正确.可能会更好采取大多数游戏采用的方法,使用设计使您的应用程序与众不同,并利用其在整个应用程序中的一致性平台,即使它没有原生的外观和感觉任何平台.

Here is the trade-off. If you design your cross-platform framework you can have your application work almost the same way on every platform. If you are sharing the UI design across all platforms, it is hard to make your design feel equally right in all cases. It might be better to take the approach adopted by most games, using a design that is distinctive to your app and make a virtue of its consistency across platforms, even though it does not have the native look and feel on any platform.

编辑 Xamarin v3 在 2014 年开始提供 Xamarin.Forms 以及纯原生,仍然遵循这里提到的哲学(自由行内联编辑,因为这样一个很好的答案)

edit Xamarin v3 in 2014 started offering choice of Xamarin.Forms as well as pure native that still follows the philosophy mentioned here (took liberty of inline edit because such a great answer)

另一方面,Xamarin Studio 没有尝试提供共享的 GUI 框架:

Xamarin Studio on the other hand makes no attempt to provide a shared GUI framework:

我们不会试图提供一个有效的用户界面抽象层跨所有平台.我们认为这是一种糟糕的方法,会导致最小公分母用户界面.(纳特·弗里德曼对蒂姆·安德森说)

We don’t try to provide a user interface abstraction layer that works across all the platforms. We think that’s a bad approach that leads to lowest common denominator user interfaces. (Nat Friedman to Tim Anderson)

这是对的;但缺点是需要为您的应用维护两个或多个用户界面设计.

This is right; but the downside is the effort involved in maintaining two or more user interface designs for your app.

关于 PhoneGap 和 Titanium 的比较,Kevin Whinnery 博客中有详细报道.

Comparison about PhoneGap and Titanium it's well reported in Kevin Whinnery blog.

PhoneGap 的目的是允许基于 HTML 的网络应用程序部署和安装为本机应用程序.PhoneGap 网站应用程序包装在本机应用程序外壳中,并且可以通过本地应用程序商店为多个平台安装.此外,PhoneGap 努力提供一个通用的原生 API 集这通常对 Web 应用程序不可用,例如基本的摄像头访问、设备联系人和传感器尚未暴露在浏览器.

The purpose of PhoneGap is to allow HTML-based web applications to be deployed and installed as native applications. PhoneGap web applications are wrapped in a native application shell, and can be installed via the native app stores for multiple platforms. Additionally, PhoneGap strives to provide a common native API set which is typically unavailable to web applications, such as basic camera access, device contacts, and sensors not already exposed in the browser.

要开发 PhoneGap 应用程序,开发人员将创建 HTML、CSS、和 JavaScript 文件在本地目录中,很像开发一个静态网站.接近原生质量的 UI 性能浏览器是一项不平凡的任务 - Sencha 雇佣了一个庞大的网络团队编程专家全职致力于解决这个问题.甚至所以,在大多数平台上,在今天的大多数浏览器中,达到原生质量的 UI 性能和响应能力根本不可能,即使使用像 Sencha Touch 这样先进的框架也是如此.是个浏览器已经足够好"了吗?这取决于您的要求和敏感性,但它无疑不如原生 UI.有时更糟,具体取决于浏览器.

To develop PhoneGap applications, developers will create HTML, CSS, and JavaScript files in a local directory, much like developing a static website. Approaching native-quality UI performance in the browser is a non-trivial task - Sencha employs a large team of web programming experts dedicated full-time to solving this problem. Even so, on most platforms, in most browsers today, reaching native-quality UI performance and responsiveness is simply not possible, even with a framework as advanced as Sencha Touch. Is the browser already "good enough" though? It depends on your requirements and sensibilities, but it is unquestionably less good than native UI. Sometimes much worse, depending on the browser.

PhoneGap 并不像人们想象的那样真正跨平台,并非所有功能在所有平台上都得到同等支持.

PhoneGap is not as truly cross-platform as one might believe, not all features are equally supported on all platforms.

  • Javascript 不是应用程序级编程语言,全局范围交互太多,不同的库通常不能很好地共存.我们花了很多时间试图让 Knockout.js 和 jQuery.mobile 很好地协同工作,但我们仍然遇到了问题.

  • Javascript is not an application scale programming language, too many global scope interactions, different libraries don't often co-exist nicely. We spent many hours trying to get knockout.js and jQuery.mobile play well together, and we still have problems.

框架和库的碎片化格局.选择太多,太多不够成熟.

Fragmented landscape for frameworks and libraries. Too many choices, and too many are not mature enough.

奇怪的是,对于我们的应用程序的需求,可以实现不错的性能(虽然不是 jQuery.Mobile).我们尝试了 jqMobi(不是很成熟,但速度很快).

Strangely enough, for the needs of our app, decent performance could be achieved (not with jQuery.Mobile, though). We tried jqMobi (not very mature, but fast).

与其他应用程序或 cdevice 功能交互的能力非常有限,无论如何这不会是跨平台的,因为 HTML5 中没有任何标准,除了一些标准,如地理定位、相机和本地数据库.

Very limited capability for interaction with other apps or cdevice capabilities, and this would not be cross-platform anyway, as there aren't any standards in HTML5 except for a few, like geolocation, camera and local databases.

Karl Waclawek

Titanium Mobile 的目标是提供高级别的跨平台 JavaScript 运行时和移动 API 开发(今天我们支持iOS、Android 和 Windows Phone.与 PhoneGap、Adobe AIR、Corona 或 Rhomobile 相比,Titanium 实际上与 MacRuby/Hot Cocoa、PHP 或 node.js 的共同点更多.Titanium 建立在关于移动开发的两个断言之上:- 有一个可以跨平台规范化的移动开发 API 的核心.这些区域应以代码重用为目标.- 有特定于平台的 API、UI 约定和开发人员在为该平台开发时应包含的功能.这些用例应存在特定于平台的代码,以提供最佳体验.

The goal of Titanium Mobile is to provide a high level, cross-platform JavaScript runtime and API for mobile development (today we support iOS, Android and Windows Phone. Titanium actually has more in common with MacRuby/Hot Cocoa, PHP, or node.js than it does with PhoneGap, Adobe AIR, Corona, or Rhomobile. Titanium is built on two assertions about mobile development: - There is a core of mobile development APIs which can be normalized across platforms. These areas should be targeted for code reuse. - There are platform-specific APIs, UI conventions, and features which developers should incorporate when developing for that platform. Platform-specific code should exist for these use cases to provide the best possible experience.

因此,出于这些原因,Titanium 并不是一次编写,到处运行"的尝试.与 Xamarin 相同.

So for those reasons, Titanium is not an attempt at "write once, run everywhere". Same as Xamarin.

Titanium 将在类似于 Xamarin 的方向上更进一步.在实践中,他们会做两个不同深度的层:Titanium 层(在 JS 中),它给你一个蜜蜂 JS-of-Titanium.如果你想更底层,已经创建了一个额外的层(称为 Hyperloop),在那里(总是用 JS)直接调用你回到 SO 的原生 API

Titanium are going to do a further step in the direction similar to that of Xamarin. In practice, they will do two layers of different depths: the layer Titanium (in JS), which gives you a bee JS-of-Titanium. If you want to go more low-level, have created an additional layer (called Hyperloop), where (always with JS) to call you back directly to native APIs of SO

AZDevelop.net

Xamarin(原为 Novell 的一个部门)在过去 18 个月中将其自己的 IDE 和用于 Visual Studio 的管理单元推向市场.这强调 Mono 的前提是创建不同的移动应用程序在保持原生 UI 开发策略的同时使用 C#.

Xamarin (originally a division of Novell) in the last 18 months has brought to market its own IDE and snap-in for Visual Studio. The underlining premise of Mono is to create disparate mobile applications using C# while maintaining native UI development strategies.

除了创建视觉设计平台来开发原生应用程序,他们集成了测试套件,并结合了本机库支持和 Nuget 风格的组件存储.最近他们通过他们的 IDE 提供 iOS 视觉设计,解放了开发人员从打开 XCode.在 Visual Studio 中,所有三个平台现在都支持,并且即将推出云测试套件.

In addition to creating a visual design platform to develop native applications, they have integrated testing suites, incorporated native library support and a Nuget style component store. Recently they provided iOS visual design through their IDE freeing the developer from opening XCode. In Visual Studio all three platforms are now supported and a cloud testing suite is on the horizon.

从一开始,Xamarin 就提供了丰富的 Android 视觉设计经验.我还没有下载或打开 Eclipse 或任何其他 IDE除了 Xamarin.真正令人惊奇的是我能够使用 LINQ处理集合以及创建自定义委托和事件让我摆脱了 Objective-C 和 Java 的限制.许多我被宠坏的库,比如 Newtonsoft JSON.Net,工作在所有三种环境中都完美无缺.

From the get go, Xamarin has provided a rich Android visual design experience. I have yet to download or open Eclipse or any other IDE besides Xamarin. What is truly amazing is that I am able to use LINQ to work with collections as well as create custom delegates and events that free me from objective-C and Java limitations. Many of the libraries I have been spoiled with, like Newtonsoft JSON.Net, work perfectly in all three environments.

在我看来有几个巨大的优势,包括

In my opinion there are several HUGE advantages including

  • 原生性能
  • 更易于阅读代码 (IMO)
  • 可测试性
  • 客户端和服务器之间的共享代码
  • 支持(尽管 Xam 在 bugzilla 上可以做得更好)

对我来说升级是结合使用 Xamarin 和 MVMCross.它仍然是一个相当新的框架,但它是从其他几个框架(例如 MvvmLight 和 monocross)的经验中诞生的,现在已经在多个已发布的跨平台项目中使用.

Upgrade for me is use Xamarin and MVVMCross combined. It's still quite a new framework, but it's born from experience of several other frameworks (such as MvvmLight and monocross) and it's now been used in at several released cross platform projects.

在了解了所有这些框架之后,我的选择是根据产品需求选择开发工具.但是,一般而言,如果您开始使用一种您感觉舒服的工具(即使它需要更高的初始开销),那么您将永远使用它.

My choice after knowing all these framwework, was to select development tool based on product needs. In general, however if you start to use a tool with which you feel comfortable (even if it requires a higher initial overhead) after you'll use it forever.

我选择了 Xamarin + MVVMCross,我必须说对这个选择很满意.我不害怕使用 Native SDK 进行软件更新或看到系统的有限功能或最琐碎的功能图形.编写结构合理的代码(DDD + SOA)非常有用核心项目与本机 C# 视图实现共享.

I chose Xamarin + MVVMCross and I must say to be happy with this choice. I'm not afraid of approach Native SDK for software updates or seeing limited functionality of a system or the most trivial thing a feature graphics. Write code fairly structured (DDD + SOA) is very useful to have a core project shared with native C# views implementation.

这篇关于Xamarin 2.0 对比 Appcelerator Titanium 对比 PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆