使用什么基于Ruby的移动跨平台解决方案?

时间:2021-10-26 12:13:17

I'm looking at ways to use Ruby for mobile cross-platform development. We need support for at least Android en iOS, with Windows Phone and Blackberry support as nice to have. It'll be an app that will end up in the app stores for the general public, so it's not an enterprisey in-house only thing. So far I've found:

我正在寻找使用Ruby进行移动跨平台开发的方法。我们至少需要Android en iOS的支持,Windows Phone和黑莓的支持也是不错的选择。这将是一个应用程序,最终将在应用程序商店面向公众,所以它不是企业内部唯一的东西。到目前为止,我发现:

  • Rhodes, covers all the platforms mentioned and open source. We don't need the extra (paid) functionality from RhoMobile right now
  • Rhodes包含了所有提到的平台和开源。我们现在不需要RhoMobile额外的(付费的)功能
  • RubyMotion; iOS only and costs 199 dolla, unfortunately there's no trial version available
  • RubyMotion;仅iOS和199美元,不幸的是没有试用版
  • Ruboto, Android only and open source
  • 只有Android和开源
  • MobiRuby, iOS only with Android support planned, open source, but looks like it's not mature enough at the time of writing for our needs
  • MobiRuby, iOS只支持Android,是开源的,但在我们编写它的时候还不够成熟

We also have a must-have use case in which we need access both the camera and the accelerometer simultaneously and draw data from the accelerometer on screen. Because this is so specific, it's not supported in any cross-platform framework I've looked at (including others like Phonegap, Titanium, etc) and it looks like I'll need to write native code for each platform to get this working.

我们还有一个必备的用例,我们需要同时访问相机和加速度计,并从屏幕上的加速度计中提取数据。因为这是如此具体,所以在我研究过的任何跨平台框架中都不支持它(包括其他框架,如Phonegap、Titanium等),看起来我需要为每个平台编写本机代码才能使其工作。

So far I'm inclined to choose Rhodes. It's a proven framework and seems to be able to do everything I need, including 'going native' for the aforementioned use case. Another option would be to use both RubyMotion and Ruboto, which are both solutions to write Ruby instead of Objective-C or Java. In theory I should be able to share common code (like connectivity and storage) across platforms, although I couldn't find any examples of anybody successfully using these two for writing an app that works on both Android and iOS.

到目前为止,我倾向于选择罗兹。它是一个经过验证的框架,并且似乎能够完成我需要的所有工作,包括针对上述用例的“本地化”。另一种选择是同时使用RubyMotion和Ruboto,它们都是编写Ruby而不是Objective-C或Java的解决方案。从理论上讲,我应该能够跨平台共享通用代码(比如连接和存储),尽管我找不到任何成功使用这两种代码的例子来编写一个在Android和iOS上运行的应用程序。

I'm wondering if somebody can confirm my thinking or that I've overlooked something. Any additional insights are welcome of course.

我想知道是否有人能证实我的想法或者我忽略了什么。当然,任何额外的见解都是受欢迎的。

3 个解决方案

#1


4  

If you choose Ruboto, you can use your UI-independent Ruby code as is. The UI code will most likely be platform-dependent anyway.

如果您选择Ruboto,您可以使用独立于ui的Ruby代码。UI代码很可能与平台相关。

Ruboto is still young, but there are more projects starting to use it. One example is

Ruboto仍然很年轻,但是有更多的项目开始使用它。一个例子是

https://play.google.com/store/apps/details?id=com.jonsoft.globalchat

https://play.google.com/store/apps/details?id=com.jonsoft.globalchat

It shares the communication Ruby code across platforms.

它跨平台共享通信Ruby代码。

being one of the developers on the Ruboto project, I can promise you good support and the full Ruby experience.

作为Ruboto项目的开发人员之一,我可以向您保证良好的支持和完整的Ruby体验。

For iOS RubyMotion looks good, but I have not used it. You should be able to use a shared code base for common logic, but separate code bases for the UI and for accessing sensors.

iOS RubyMotion看起来不错,但我还没用过。您应该能够为通用逻辑使用共享代码库,但是为UI和访问传感器使用单独的代码库。

#2


2  

I would go ahead and use native Java for Android and RubyMotion for iOS and have two code bases. RubyMotion is the most stable of the ones you mentioned and worth it for iOS development, but there isn't a good alternative on the Android platform.

我将继续使用本机Java用于Android, RubyMotion用于iOS,并有两个代码库。RubyMotion是您提到过的最稳定的iOS开发工具,值得一试,但是Android平台上没有好的替代品。

#3


0  

Rhodes has nothing do with web apps. Rhodes allows you to build native apps with Ruby and is many years more mature than those alternatives. It also supports every major smartphone OS

罗兹与网络应用毫无关系。Rhodes允许您使用Ruby构建本地应用程序,并且比这些替代程序成熟许多年。它还支持所有主要的智能手机操作系统

#1


4  

If you choose Ruboto, you can use your UI-independent Ruby code as is. The UI code will most likely be platform-dependent anyway.

如果您选择Ruboto,您可以使用独立于ui的Ruby代码。UI代码很可能与平台相关。

Ruboto is still young, but there are more projects starting to use it. One example is

Ruboto仍然很年轻,但是有更多的项目开始使用它。一个例子是

https://play.google.com/store/apps/details?id=com.jonsoft.globalchat

https://play.google.com/store/apps/details?id=com.jonsoft.globalchat

It shares the communication Ruby code across platforms.

它跨平台共享通信Ruby代码。

being one of the developers on the Ruboto project, I can promise you good support and the full Ruby experience.

作为Ruboto项目的开发人员之一,我可以向您保证良好的支持和完整的Ruby体验。

For iOS RubyMotion looks good, but I have not used it. You should be able to use a shared code base for common logic, but separate code bases for the UI and for accessing sensors.

iOS RubyMotion看起来不错,但我还没用过。您应该能够为通用逻辑使用共享代码库,但是为UI和访问传感器使用单独的代码库。

#2


2  

I would go ahead and use native Java for Android and RubyMotion for iOS and have two code bases. RubyMotion is the most stable of the ones you mentioned and worth it for iOS development, but there isn't a good alternative on the Android platform.

我将继续使用本机Java用于Android, RubyMotion用于iOS,并有两个代码库。RubyMotion是您提到过的最稳定的iOS开发工具,值得一试,但是Android平台上没有好的替代品。

#3


0  

Rhodes has nothing do with web apps. Rhodes allows you to build native apps with Ruby and is many years more mature than those alternatives. It also supports every major smartphone OS

罗兹与网络应用毫无关系。Rhodes允许您使用Ruby构建本地应用程序,并且比这些替代程序成熟许多年。它还支持所有主要的智能手机操作系统