Android 和 iOS (iPhone/iPad) 上的本机应用程序与跨平台解决方案之间的权衡
我即将开发平板电脑(Android/iPad)上的应用程序。 我们的客户要求我们使其跨平台,除非有任何理由坚持使用一个平台。 我在这里查看了一些与跨平台 iOS/Android 开发相关的帖子,但我仍然不确定是否应该在特定平台上开发本机应用程序,还是应该尝试使其跨平台。 我是在移动设备上开发应用程序的新手。 如果您能提供任何建议/经验,那就太好了!
据我所知,出于技术原因,权衡如下:
- 本机应用程序速度更快,但在其他平台上重用代码并不容易。
- 使用基于网络的应用程序(例如PhoneGap)的跨平台解决方案性能较慢,对操作系统和硬件API的访问有限,用户界面类似网络。
- 像Appcelerator Titanium这样的跨平台解决方案将代码编译为本机代码,但我不确定它的局限性(如果我在开发三个月后必须将其更改回本机应用程序,我会哭!)并且它需要花钱。
另外,对于在平板电脑上开发本机应用程序或跨平台应用程序所需的时间/精力来说,一般来说,开发/维护本机应用程序是否比跨平台解决方案更容易、更可靠?
有什么建议吗?
提前致谢! :)
I'm about to work on developing an application on tablets (Android/iPad).
Our clients ask us to make it cross platform unless there is any reason to stick to one.
I've looked at some posts related to cross-platform iOS/Android development here, but I'm still not sure if I should just develop a native application on a specific platform or I should try to make it cross-platform.
I'm new to developing applications on mobile devices.
If you can provide any advice/experience, that would be great!
As far as I know, for technical reasons, the trade-offs are as follows:
- Native applications are faster, but it's not easy to reuse the codes on other platforms.
- Cross-platform solutions using web-based applications (e.g. PhoneGap) have slower performance, limited access to OS and hardware APIs, web-like user interface.
- Cross-platform solutions like Appcelerator Titanium compile the codes to native codes but I'm not sure about its limitation (if I have to change it back to native application after developing for three months, I'll cry!) and it costs money.
Also, for time/effort needed to develop a native application or cross-platform application on tablets, in general, is it easier and more reliable to develop/maintain a native application than a cross-platform solution?
Any suggestions?
Thanks in advance! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就我个人而言,我会坚持使用本机应用程序。我在一家公司工作,该公司也希望为多个平台创建应用程序,他们一直在寻找本机开发的替代方案,例如 Titanium 和 PhoneGap。我们选择了以下方法:
-getFlightInfoWithId:forUserId:
将变成某种东西就像 Java 中的(void)getFlightInfo(flightId, userId)
一样。视图层和控制器层可能会有很大差异,主要是因为 Android 和 iOS 设备具有不同的 GUI 指南和功能(例如,Android 屏幕尺寸可能相差很大,而 iOS 上只有 2 个实际选项)。
对于其他较小的平台,我们将提供 HTML5 应用程序。对我来说,本机应用程序总是比使用跨平台工具集创建的应用程序更可取,因为通常本机应用程序应该表现更好,应该有更好的“感觉”,并且可能具有更多功能,例如可能能够使用某些本机的硬件功能平台且在跨平台工具集中不可用。
Personally I would stick with native apps. I'm working for a company that wants to create apps for multiple platforms as well and they have been looking for alternatives to native development, such as Titanium and PhoneGap. We've chosen for the following approach:
-getFlightInfoWithId:forUserId:
will become something like(void)getFlightInfo(flightId, userId)
in Java.The view and controller layers will probably differ in huge ways, mostly because Android and iOS devices have different GUI guidelines and capabilities (e.g. Android screen sizes can differ a lot, whereas on iOS there are only 2 real options).
For other smaller platforms we'll be offering a HTML5 app. To me native apps are always preferable to apps created with cross-platform toolsets as generally native apps should perform better, should have a better 'feeling' and might have some more capabilities, e.g. might be able to use some hardware features that are native to the platform and unavailable in a cross-platform toolset.
坏消息是,除非您打算编写网络,否则您将不得不编写两个版本。
好消息是您可以在他们之间共享资产。
我猜你可以用 C 语言编写 iPad 版本的大部分内容,然后通过 NDK 将其编译为 Android,但是还有所有 UI 内容,因此它仍然是两个版本。
The bad news is that unless you're planning on writing a web, then you're going to have to write two versions.
The good news is that you can share the assets between them.
I guess you write could write large chunks of your iPad version in C, then compile it for Android via the NDK, but then there's all the UI stuff and so it's still gonna be two versions.