写作为Android和iOS的应用程序应用程序、Android、iOS

2023-09-05 06:21:52 作者:゛久病成医ぅ

我要编写能够Android和苹果设备上运行的应用程序。在这一点上我已经找到了一些解决方案:

I want to write an application that can run on both Android and Apple devices. At this point I have found a few of solutions:

写两遍

Write everything twice

使用的框架,例如Appcelerator的钛或PhoneGap的,

Use a framework such as Appcelerator Titanium or PhoneGap,

使用C ++,然后写无论是在Java和Objective-C中(如C ++既能平台上运行),

Use C++, and then write the UI parts both in Java and Objective-C (as C++ can be run on both platform),

你有什么经验和建议就这个问题?

What are your experiences and suggestions regarding this problem?

推荐答案

这取决于你的项目。如果你需要开发的东西比较复杂,如果单独开发每个平台的最好的。这是因为你一定会需要考虑到,不能直接通过一个通用的中介API解决的帐户复杂的问题/错误,例如:关于线程,缓存,数据存储管理。这种方法可以让您充分利用每个平台所提供的好处。第三方平台也比较慢,当一个新的SDK / OS版本发布时采用新的原生功能。

It depends on your project. If you need to develop something relatively complex, it's best if you develop separately for each platform. This is because you will definitely need to take into account complex issues/bugs that cannot be addressed directly through a generic intermediary API, e.g. regarding threading, caching, data store management. This approach lets you take advantage of the benefits that each platform has to offer. Third-party platforms are also slower to adopt new native features when a new SDK/OS version is released.

不过,你提到一个平台,比如那些足以满足低复杂度的项目,可以显著降低开发成本。你需要仔细评估你的需求。

However, a platform such as those that you mentioned is sufficient for projects with low complexity and can reduce your cost of development significantly. You need to carefully evaluate your needs.

另外要注意这个特殊的知会备忘:将来的扩展。你可能会发现自己受到第三方API如果您需要在将来添加新的功能。

Also take note of this particular caveat: future extensions. You might find yourself limited by a third party API if you need to add new functionality in the future.