是否有用于开发 iPhone / Android 应用程序的多平台框架?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30953/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 02:04:27  来源:igfitidea点击:

Is there a multi-platform framework for developing iPhone / Android applications?

iphoneandroidframeworksmiddleware

提问by TJ Seabrooks

I am interested in writing applications for the iPhone and the Android platform. I was hoping to find a middleware / framework that abstracted away some of the differences in the APIs and allow me to specify the target platform at build time. Is there such a framework existing or planned?

我对为 iPhone 和 Android 平台编写应用程序感兴趣。我希望找到一个中间件/框架,可以抽象出 API 中的一些差异,并允许我在构建时指定目标平台。是否存在或计划建立这样的框架?

采纳答案by Brad Parks

Phonegapis a JavaScript/CSS/HTML based framework that targets the iPhone, Android, and the Blackberry. It (on the iPhone at least) can be bundled as a native app too. The UI layer for these apps typically is built in html/JavaScript and can be slower than a true native app.

Phonegap是一个基于 JavaScript/CSS/HTML 的框架,面向 iPhone、Android 和 Blackberry。它(至少在 iPhone 上)也可以作为本机应用程序捆绑在一起。这些应用程序的 UI 层通常是用 html/JavaScript 构建的,可能比真正的原生应用程序慢。

phonegap

电话间隙



React Nativeenables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about — learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native. The UI for React Native applications are native controls - so your UI is usually faster than a pure HTML/JavaScript approach for GUI management.

React Native使您能够使用基于 JavaScript 和 React 的一致开发人员体验在本机平台上构建世界一流的应用程序体验。React Native 的重点是在您关心的所有平台上提高开发人员的效率——一次学习,随处编写。Facebook 在多个生产应用程序中使用 React Native,并将继续投资于 React Native。React Native 应用程序的 UI 是原生控件 - 因此您的 UI 通常比用于 GUI 管理的纯 HTML/JavaScript 方法更快。

React Native

反应本机



Unityis a cross-platform game engine developed by Unity Technologies and used to develop video games for PC, consoles, mobile devices and websites. Unity is notable for its ability to target games to multiple platforms. Supported platforms include Android, Apple TV, BlackBerry 10, iOS, Linux, Nintendo 3DS line, OS X, PlayStation 4, PlayStation Vita, Unity Web Player (including Facebook), Wii, Wii U, Windows Phone 8, Windows, Xbox 360, and Xbox One.

Unity是由 Unity Technologies 开发的跨平台游戏引擎,用于为 PC、游戏机、移动设备和网站开发视频游戏。Unity 以其将游戏定位到多个平台的能力而著称。支持的平台包括 Android、Apple TV、BlackBerry 10、iOS、Linux、Nintendo 3DS 系列、OS X、PlayStation 4、PlayStation Vita、Unity Web Player(包括 Facebook)、Wii、Wii U、Windows Phone 8、Windows、Xbox 360、和 Xbox 一。

Unity

统一



OpenFLis an opensource port of the Flash API to Desktop,Browser,iOs,Android,Flash,HTML5,etc. and is an option to consider for those coming from a Flash world. It builds to native binaries and targets browsers as well (Flash/HTML5).

OpenFL是 Flash API 到桌面、浏览器、iOs、Android、Flash、HTML5 等的开源端口。对于那些来自 Flash 世界的人来说,这是一个可以考虑的选择。它构建到本机二进制文件并针对浏览器(Flash/HTML5)。

openfl

打开fl



MonoGameis an open source implementation of the Microsoft XNA 4.x Framework. It makes it easy for XNA developers to create cross-platform games with extremely high code reuse. It currently supports iOS, Android, Windows (both OpenGL and DirectX), Mac OS X, Linux, Windows 8 Store, Windows Phone 8, PlayStation Mobile, and the OUYA console.

MonoGame是 Microsoft XNA 4.x 框架的开源实现。它使 XNA 开发人员可以轻松创建具有极高代码重用率的跨平台游戏。它目前支持 iOS、Android、Windows(OpenGL 和 DirectX)、Mac OS X、Linux、Windows 8 Store、Windows Phone 8、PlayStation Mobile 和 OUYA 控制台。

monogame

单一游戏



Adobe FlashAnd believe it or not, Adobe Flash can publish native binaries to ios, android, desktop and of course the web. The performance is reasonable, but not incredible. If you had a Flash game, you may be able to take it to mobile very easily. And this does not require any plugins of any sort. It actually creates a native standalone binary that runs on each platform.

Adobe Flash不管你信不信,Adobe Flash 可以将本地二进制文件发布到 ios、android、桌面,当然还有 web。表现是合理的,但并不令人难以置信。如果你有一个 Flash 游戏,你可以很容易地把它带到手机上。这不需要任何类型的插件。它实际上创建了一个在每个平台上运行的本机独立二进制文件。

adobe

土坯

回答by Carlos Carrasco

Edit: Since this question was asked a number of viable solutions have been developed. While the tone of this answer may still be accurate (To benefit 100% from the HW / OS a native app is likely necessary) you can find a number of possible answers below this question.

编辑:自从提出这个问题以来,已经开发了许多可行的解决方案。虽然这个答案的语气可能仍然是准确的(为了 100% 从硬件/操作系统中受益,可能需要一个本机应用程序),您可以在这个问题下方找到许多可能的答案。

Both Android and the iPhone have very strongly defined user interfaces. Even if you found a framework that bridged the huge differences on the most lower aspect levels (Android is programmed in Java on top of a custom VM, iPhone is native code programmed in Objective-C) and in the higher levels (iPhone apps are a completely sandboxed and isolated, the Android object model is distributed and classes are freely invoked between apps and libraries) your final app would feel alien and out of place in either of them. Think about the lack of multitouch in Android, or the lack of dedicated hardware buttons in the iPhone.

Android 和 iPhone 都有非常明确的用户界面。即使你找到了一个框架,它在最底层(Android 是在自定义 VM 之上用 Java 编程,iPhone 是用 Objective-C 编程的本机代码)和更高级别(iPhone 应用程序是一个完全沙盒和隔离,Android 对象模型是分布式的,并且类可以在应用程序和库之间自由调用)您的最终应用程序在它们中的任何一个中都会感到陌生和不合适。想想 Android 中缺少多点触控,或者 iPhone 中缺少专用硬件按钮。

Your best bet would be to develop a platform specific user interface and have the model and core logic of your application in some kind of scripting language. Then find an interpreter in plain C (for the iPhone) and one in Java (for Android.) Scheme, Lisp and Javascript could fit the bill. Just make sure the interpreter is not exposed to end users or you would be violating the iPhone NDA...

最好的办法是开发一个特定于平台的用户界面,并以某种脚本语言拥有应用程序的模型和核心逻辑。然后找到一个纯 C 语言的解释器(用于 iPhone)和一个用 Java 语言(用于 Android)的解释器。Scheme、Lisp 和 Javascript 可以满足这个要求。只需确保解释器不会暴露给最终用户,否则您将违反 iPhone NDA...

If your app is data-heavy you could follow the model of many iPhone apps and develop native user interfaces for iPhone and Android, and have all the application logic in a remote server. Your UI becomes the only installed part of the application and everything else is hosted away on the net. This has the added advantage of having the possibility to offer roaming profiles between different devices and a web interface.

如果您的应用程序数据量大,您可以遵循许多 iPhone 应用程序的模型,为 iPhone 和 Android 开发本机用户界面,并将所有应用程序逻辑放在远程服务器中。您的 UI 成为应用程序中唯一安装的部分,其他所有内容都托管在网络上。这具有额外的优势,可以在不同设备和 Web 界面之间提供漫游配置文件。

回答by pix0r

Adding another service to the pile here: Rhomobileis looking to create just this. It does look quote dumbed-down -- think back to the web in the early 90's. But it could be the easiest way to port your favourite app to every major mobile platform.

在此处添加另一项服务:Rhomobile正在寻求创建此服务。它确实看起来很简单——回想一下 90 年代初的网络。但这可能是将您最喜爱的应用程序移植到每个主要移动平台的最简单方法。

More details: Rhomobile promises: Build once, deploy to any smartphone

更多细节:Rhomobile 承诺:构建一次,部署到任何智能手机

( Note: I don't work for Rhomobile; just came across the story today. )

(注意:我不为 Rhomobile 工作;今天刚看到这个故事。)

回答by Matthew Eshleman

I have no direct experience with iPhone or Android, but I just read an article about "Titanium" and then when I visited their site, found this:

我没有直接使用 iPhone 或 Android 的经验,但我刚刚阅读了一篇关于“Titanium”的文章,然后当我访问他们的网站时,发现了这个:

http://www.appcelerator.com/products/titanium-mobile/

http://www.appcelerator.com/products/titanium-mobile/

回答by j7nn7k

I work(ed) quite a bit with the "native" solutions Obj-C and Java (4 Android). I also build an App with Appcelerator for iPhone and Android which works just fine. The Appcelerator APIs are quite extensive. The Appcelerator Kitchen Sink App shows a lot of elements and functionality ready to include in an app ( https://github.com/appcelerator/KitchenSink). However since my Appcelerator app is not too complex I don't feel comfortable to generally recommend it. A colleague told me that their dev team tried it and they were not satisfied. He could not name a real reason though. However I will go on testing it to see where the limitations are. One big limitation is the platform support (currently only iOS and Android).

我经常使用“原生”解决方案 Obj-C 和 Java(4 Android)。我还使用 Appcelerator 为 iPhone 和 Android 构建了一个应用程序,效果很好。Appcelerator API 非常广泛。Appcelerator Kitchen Sink 应用程序显示了许多可以包含在应用程序中的元素和功能(https://github.com/appcelerator/KitchenSink)。但是,由于我的 Appcelerator 应用程序不太复杂,所以我不太愿意推荐它。一位同事告诉我,他们的开发团队尝试过,但他们并不满意。但他说不出真正的原因。但是,我将继续测试它以查看限制在哪里。一个很大的限制是平台支持(目前只有 iOS 和 Android)。

As to Rhodes, this solution looks quite impressive on paper, especially in terms of supported platforms. I see some problems with it though. First, the demo apps and kitchen sink app need a lot of disk space, run a bit choppy and look funky sometimes (at least on Android). Second, there very few "real world" applikations to find. I mean apps that have been downloaded at least more than 1000 times and serving real world needs other than just demo purposed. Usability to me has top priority in mobile (consumer) apps!

对于 Rhodes,这个解决方案在纸面上看起来非常令人印象深刻,尤其是在支持的平台方面。我看到它有一些问题。首先,演示应用程序和厨房水槽应用程序需要大量磁盘空间,有时运行有点不稳定并且看起来很时髦(至少在 Android 上)。其次,可以找到的“真实世界”应用程序很少。我的意思是下载至少超过 1000 次并满足现实世界需求的应用程序,而不仅仅是出于演示目的。在移动(消费者)应用程序中,可用性对我来说是重中之重!

I see a big potential in HTML/CSS/JavaScript/PhoneGap apps. Recently I read quite some articles about bigger companies using HTML(5) to build their apps (eg. Netflix http://mashable.com/2010/12/03/netflix-html5/, Zynga http://www.spielsucht24.de/2010/12/21/zynga-launches-html5-mafia-wars-atlantic-city-for-mobile-web/) There are still some problems with usability and snappyness that need to be solved when building mobile apps with web technologies. Another problem could be the testing, debugging and maintenance of enterprise level HTML apps.

我看到了 HTML/CSS/JavaScript/PhoneGap 应用程序的巨大潜力。最近我读到有关使用HTML(5)来构建他们的应用规模较大的公司颇有些物品(例如Netflix的。http://mashable.com/2010/12/03/netflix-html5/,Zynga的HTTP://www.spielsucht24。 de/2010/12/21/zynga-launches-html5-mafia-wars-atlantic-city-for-mobile-web/) 在使用 Web 技术构建移动应用程序时,仍然存在一些可用性和敏捷性问题需要解决. 另一个问题可能是企业级 HTML 应用程序的测试、调试和维护。

回答by Adam Blum

Rhomobile's Rhodes framework does this. Rhodes apps are native for each individual smartphone

Rhomobile的 Rhodes 框架就是这样做的。Rhodes 应用程序适用于每个单独的智能手机

回答by Eric Schoonover

Mytopiahas an unreleased framework called RUGS. They presented recently at TechCrunch 50 conference and their technology looked very interesting. They were able to compile an application that ran on all smartphone platforms (and was able to take advantage of the abilities of each... accelerometer on the iPhone for instance). Unfortunately their websitesays you need to email them if you want more information. Might be worth shooting them an email if you really want to develop on a cross platform smartphone targeted system.

Mytopia有一个未发布的框架,称为 RUGS。他们最近在 TechCrunch 50 大会上发表了演讲,他们的技术看起来非常有趣。他们能够编译一个在所有智能手机平台上运行的应用程序(并且能够利用每个......例如iPhone上的加速度计的能力)。不幸的是,他们的网站说如果你想了解更多信息,你需要给他们发电子邮件。如果您真的想在跨平台智能手机目标系统上进行开发,可能值得向他们发送电子邮件。

I watched their presentation over the TC50 webcast, but unfortunately am not able to find a video for you now.

我通过 TC50 网络广播观看了他们的演示,但遗憾的是现在无法为您找到视频。

Please post back here with a summary of what framework you decide to use and why you chose it.

请在此处发回您决定使用的框架的摘要以及您选择它的原因。

回答by Lee

QuickConnectiPhone lets you write your app in JavaScript and yet it is still installable. An Android version is in unreleased Alpha at this point.

QuickConnectiPhone 允许您使用 JavaScript 编写应用程序,但它仍然可以安装。Android 版本此时处于未发布的 Alpha 版中。

Having both would allow you to create your app in JavaScript, CSS, and HTML, make calls down to either the iPhone or the Android phone for device behaviors such as vibration, GPS locations, etc.

两者都可以让你用 JavaScript、CSS 和 HTML 创建你的应用程序,通过 iPhone 或 Android 手机调用设备行为,如振动、GPS 位置等。

The iPhone version is downloadable from https://sourceforge.net/projects/quickconnect/and if you contact me I can send you the Android version.

iPhone 版本可从https://sourceforge.net/projects/quickconnect/下载,如果您联系我,我可以向您发送 Android 版本。

回答by Lee

Check out this:

看看这个:

http://www.xmlvm.org/overview/

http://www.xmlvm.org/overview/

It is a project that attempts to be able to cross-compile programs written in a variety of source languages to a variety of target languages. One of the initial test cases was to write programs in Java and run them on an iPhone. Watching the video on the site is worthwhile. They have discussed the possibility of being able to target Android as well.

它是一个试图将用各种源语言编写的程序交叉编译成各种目标语言的项目。最初的测试用例之一是用 Java 编写程序并在 iPhone 上运行它们。观看网站上的视频是值得的。他们也讨论了能够以 Android 为目标的可能性。

With that said, I haven't tried it. The project seems quite beta, and there isn't a lot of activity on their SourceForge site.

话虽如此,我还没有尝试过。该项目似乎还处于测试阶段,并且他们的 SourceForge 站点上没有很多活动。

回答by Krusty

You can develop Java applications for IPhone with iSpectrum. This way you'll be able to re-use a consistent amount of your application code between Android and iPhone (and possibly desktop applets or J2ME MIDlets depending of what you do :) )

您可以使用 iSpectrum 为 iPhone 开发 Java 应用程序。通过这种方式,您将能够在 Android 和 iPhone 之间重复使用一致数量的应用程序代码(可能还有桌面小程序或 J2ME MIDlets,具体取决于您的工作:))

More infos at http://www.flexycore.com

更多信息请访问http://www.flexycore.com