PhoneGap 比 Titanium 更容易构建吗?
我们正在寻找将移动 Web 应用程序移植到本机应用程序的良好方法,直到我们拥有构建真正本机应用程序的资源。我们已将范围缩小到 PhoneGap 和 Titanium。
我们的应用程序有 HTML5 移动版本。它使用诸如 RPC over websockets 和其他一些 JS 库之类的东西。如果我们使用 PhoneGap,我们似乎可以继续使用完全相同的架构,而与 Titanium 一样,我们似乎需要重建这些库和过程才能与 Titanium 一起使用。
这是真的吗?这些平台有何不同?
谢谢!
We are looking for a good port of our mobile web application to native app until we have the resources to build a truly native application. We have narrowed it down to PhoneGap and Titanium.
We have an HTML5 mobile version of our application. It uses things like RPC over websockets and some other JS libs. It seems as if we can just continuing using the exact same architecture if we go with PhoneGap, where as with Titanium it seems we would need to rebuild these libs and procedures to work with Titanium.
Is this true? How do these platforms differ?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Phonegap 是您最好的选择。您可以将当前的所有代码放入www目录中,然后phonegap会将其打包到应用程序中。 Phonegap 不会创建 Web 应用程序,您创建 Web 应用程序并让 Phonegap 为您打包它。
如果您要使用 Titanium,您将无法使用任何当前的 html 或 css 代码。如果您将 JS 逻辑与视图分开,那么您可以重复使用此逻辑,然后为钛应用程序构建新视图,但这非常耗时。
Titanium 不是一个好的框架,由于创建 UI 非常困难,开发时间太长。这也很麻烦。我们用 Titanium 为 Android 开发了一个应用程序,我们将使用网络技术重写。
外部 JS 库在 Titanium 中很难使用的说法并不正确。一切都转换为本机代码。
Phonegap is your best bet here. You can put all your current code into the www directory, and then phonegap will package that into an app. Phonegap doesn't create a web app, you create the web app and let phonegap package it for you.
If you were to use Titanium you would not be able to use any of your current html or css code. If you have kept your JS logic separate from your views, then you could re-use this logic and then build new views for a titanium application but that's very time consuming.
Titanium is not a good framework, dev time is way too long due to how difficult it is to create a UI. It's also quite buggy. We developed an app in Titanium for Android and we're going to rewrite using web technologies.
It's not true that external JS libraries are difficult to use in Titanium. Everything is converted to native code.
这个博客很好地总结了PhoneGap 和 Titanium Appcelerator 的优缺点。
简短摘要:PhoneGap 提供了一个桥梁,使基于标准的 Web 应用程序能够访问本机功能。 Appcelerator 是一个专有的(非基于 HTML 的)框架,可以使用 JavaScript 创建本机应用程序。
This Blog has a good summary of the pros and cons of PhoneGap and Titanium Appcelerator.
Short summary: PhoneGap provides a bridge to enable standards-based web apps to access native capabilities. Appcelerator is a proprietary (non-HTML based) framework that enables the creation of native apps in JavaScript.
Phonegap 对您来说会更容易。只需移植您现有的代码即可。虽然不是本土的。钛将被重写。
Phonegap will be much easier for you. Just port in your existing code. Not native though. Titanium will be a rewrite.
主要区别之一是 PhoneGap 创建一个用 JavaScript 编写的 Web 应用程序,而 Titanium 创建本机应用程序,其中 JavaScript 代码被编译为 Java 或 Objective-C。因此,您无法轻松地将外部 JavaScript 库与 Titanium 一起使用。
One of the main difference is that PhoneGap creates a webapp written in JavaScript and Titanium creates native apps where your JavaScript code is compiled to Java or Objective-C. So you can't easily use external JavaScript libs with Titanium.