多平台 Web 应用程序框架选择策略
问题
您构建需要部署到桌面 Web 浏览器和移动设备(Android、iPhone 等)上的类桌面 Web 应用程序的策略是什么?
一个行动方案可能是首先选择最佳框架来构建在计算机(即不是移动设备)上运行的部分。作为一个类似桌面的应用程序,GWT+ExtGWT 是一个很好的候选框架,因为它提供了:
- 基于 Java 的开发,比通过 ExtJS 在 Javascript 中开发具有更高的可扩展性/稳定性
- 良好的
- 调试性 良好的可测试性
接下来,您需要部署此框架移动设备上也有应用程序。那么你要怎么走呢?为 Android 编写一个单独的实现(与 GWT 分开),为 iOS 编写另一个实现(在 Objective-C 中),为 Windows Mobile 编写另一个实现,等等?
与上述相关
,我看到了 PhoneGap 的演示,它声称您可以使用 Javascript+HTML 进行开发,并为所有移动平台生成代码:Android、iOS 等。
但是,PhoneGap 不是一个选项,因为我认为它集成得不好更重要的是,使用 GWT 时,它不会生成可以利用后台、服务等功能的本机应用程序(请参阅 http://www.youtube.com/watch?v=xHXn3Kg2IQE 了解为什么原生 Android 应用比基于浏览器的应用要好得多)。可能还有其他框架,例如 PhoneGap,但我不知道,但目前我只看到:
- 一种 GWT 实现
- 、一种 Android 实现、
- 一种 iPhone 实现
- ,等等...
Issue
What is your strategy for building a desktop-like webapp that needs to be deployed to desktop web browsers and on mobile devices(Android, IPhone, etc)?
A course of action could be to firstly select the best framework for building the part that runs on computers(i.e. not mobile devices). Being a desktop-like app, a good candidate framework is GWT+ExtGWT since it provides:
- Java-based development which is much scalable/solid than developing in Javascript via ExtJS for example
- Good debugging
- Good testability
Next, you'd want to deploy this app on mobile devices too. So how do you go from here? Write a separate implementation(separate from GWT) for Android, another one for iOS(in objective-c), another one for Windows Mobile, and so on?
Related
Related to above, I saw the presentation of PhoneGap which claims you develop in Javascript+HTML and it generates code for all mobile platforms: Android, iOS, etc.
However, PhoneGap is not an option since I don't think it integrates well with GWT and more important, it doesn't generate a native app which can take advantage of features like backgrounding, services, etc(see http://www.youtube.com/watch?v=xHXn3Kg2IQE for why native Android apps are much better than browser-based ones). There may be other frameworks like PhoneGap out there that I'm not aware of though but at this point I only see:
- one implementation with GWT
- one implementation for Android
- one implementation for IPhone
- and so on ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您已经计划针对多个平台进行开发,那么至少考虑一下 PhoneGap 或 Appcelerator 等跨平台框架是个好主意。除了要为多个平台进行开发这一事实之外,还需要考虑其他几个重要问题。
您还指出了在调试和可测试性方面需要考虑的两个重要问题。在单元测试方面,任何原生平台都很难进行单元测试。对于大多数本机平台来说,调试非常容易。
关于PhoneGap,了解一些有关它的事情很重要。
您可以编写 PhoneGap 插件。插件本质上是任何给定平台的本机代码,它几乎可以完成您想要在本机代码中执行的任何操作(后台服务、opengl 等),并使其可以在 Web 视图中被 JavaScript 访问。
您可能会对多个开源项目非常感兴趣,例如 GWT-PhoneGap 、QUnit 用于 JavaScript 单元测试,Weinre 用于类似 Firebug 的调试。
希望有帮助!
If you are already planning on developing for multiple platforms, it is a good idea to at least consider cross platform frameworks like PhoneGap or Appcelerator. Beyond the fact that you are developing for multiple platforms there are a couple of other important questions to consider.
You also point out two more great questions to consider in debugging and testability. In terms of unit testing, any native platform is very difficult to unit test. Debugging is pretty easy for most native platforms.
Regarding PhoneGap, it is important to know a few things about it.
You can write PhoneGap plugins. A plugin is essentially native code for any given platform that can do pretty much anything you would want to do in native code -- background services, opengl, etc -- and make it accessible to JavaScript in the web view.
There are several open source projects that you might be very interested in such as GWT-PhoneGap, QUnit for JavaScript unit testing, and Weinre for Firebug like debugging.
Hope that helps!