
RubyMotion 3.0 Sneak Peek: Android Support - blacktulip
http://blog.rubymotion.com/post/87048665656/rubymotion-3-0-sneak-peek-android-support
======
danielsju6
Maybe it's petty but I've lost confidence in Ruby Motion since I've had a pull
request open against it for whole year because they don't support enterprise
deployment out of box. The fix is pretty damn simple too
[https://github.com/HipByte/RubyMotion/pull/64/files](https://github.com/HipByte/RubyMotion/pull/64/files)

You'd think enterprise would be a prime use case here. Sucks to have to keep
your own fork up to date.

Moral of the story, if you have a Github repo please accept pulls; and if you
don't you loose customers.

~~~
phillmv
I'm just smiling at the juxtaposition. It's amusing what in most circumstances
would be a fact of life becomes a major sticking point. Apple doesn't take
pull requests. I'm sure Google accepts patches, sometimes, but the process
doesn't strike me as quite on the PR-level of ease.

Is the alternative PhoneGap, and the hypothesis that they're more responsible
with taking ownership of your pet features? Just curious.

~~~
danielsju6
PhoneGap works well so does Xcode or anything that doesn't aim to replace the
typical processes.

It's just such a stupid thing with their rake command, it checks to see if
your device is provisioned to save you an unsavory error message. Since I have
an Apple Enterprise account I am not subject to the 100 device limit and
having to provision the device's UDID; so they're checking a non-existent
array in the provisioning profile.

Less a pet feature, more an edge case with "rake device" that they missed.
It's like they're completely oblivious to an entire class of provisioning
profiles in their tooling.

Which doesn't speak well to the maturity of the tool, have they seriously
never dealt with an enterprise customer or for that matter an app that had
more than 100 devices beta testing it? Almost every iOS development firm I
know uses the enterprise provisioning profiles since it's a more simple
process than having to juggle UDIDs.

~~~
afternooner
It could be a bad sign, or it could speak to priorities, and your priorities
are not their priorities it seems. Personally, I accept all pull requests that
are solid, written to my standards, fix or extend a feature that is a
priority, are accompanied with unit tests, and do not impact or impinge on
another feature or future feature. I do not however accept all pull requests.
Part of this is that if there is no demand and it's a single individuals edge
case, then I'll very heavily scrutinize the patch. If I don't agree, don't
understand exactly what every line is doing, or do not feel it will be used by
a significant portion of the user base then I won't pull it. Because moving
forward, I will have to maintain it, and that isn't free. And if people don't
like that, they can fork it.

~~~
danielsju6
True, but if your business is alternative toolchains to Apple's own; and it's
shown to me that you don't support something I know a great deal of iOS
developers use then I lose a bit of faith in your marketing message that
"lot's of important apps use us... and don't mind what all the naysayers say
about our garbage collector, give us $200/year and give it a shot yourself".

It's one thing that my pull hasn't been accepted, the other bigger concern is
the nature of the unpatched code that says to me that no one serious has used
Ruby Motion. We aren't talking a hobbyist open-source project here, this is a
partially open-source commercial offering.

Source: I am a Ruby developer who has to develop native on occasion... and I
run a company who's job it is to deploy beta/in-house applications to mobile
devices. I just ran a quick sql query and 43.7% of the hundreds of thousands
of applications we host are deployed with enterprise provisioning. I wouldn't
call this a personal edge case.

~~~
afternooner
Enterprise and government comes with a lot of baggage that no sane developer
would ever try to take on. You are manifesting your priorities on them, and
that simply may not be the case. The $200 price point is likely that high in
order to keep the client base low. I'm not saying you're wrong, but Apple
itself barely supports enterprise with most of their enterprise management
bits being third party. A laptop without a docking station??? Crazy, they
might as well not sell computers...

Source: Work for government, not entirely sane, have had Apple reps brought in
to discuss in house dev, written in house application, ruby, C#, C, Obj-C, JS,
C++ developer in order of preference.

~~~
danielsju6
On iOS "enterprise provisioning" means less baggage. No UDIDs, which are
deprecated in software BTW. To be clear this is a tiny patch that adds support
for some 40%+ of dev shops and all enterprises. All we are talking about is
this:

    
    
      unless App.config.provisions_all_devices? || App.config.provisioned_devices.include?(device_id)
        App.fail "Device ID `#{device_id}' not provisioned in profile `#{App.config.provisioning_profile}'"
      end
    

Where the provisions all devices is my bit supported by a single line helper,
it's not scary. If you have more than 100 devices beta testing your app you
use enterprise provisioning PERIOD, it doesn't have anything to do with
classic "enterprise" except you need a DUNs and to pay Apple an extra
$100/year.

Almost every dev shop that is more than two guys I know uses this.

------
bratsche
"The object model of RubyMotion for Android is based on Java. Ruby classes,
objects, methods and exceptions are Java classes, objects, methods, and
exceptions, and vice-versa. No bridge is involved."

But then later it says "The runtime uses the Java Native Interface (JNI) in
order to integrate with Java".

And then later it says, "RubyMotion Android apps are fully compiled into
optimized machine code, exactly like their iOS and OS X counterparts."

Does any of this make any sense? They seem to be contradicting themselves left
and right on the same page.

~~~
stusmall
That jumped out to me too. There is a significant performance hit when you
make JNI calls. Last I looked not all of Android's API are easily exposed to
native code. Constantly context switching from native to managed can be
beastly. I'd be curious on how often and when it is doing these JNI calls,
what is native and what is java.

~~~
crashandburn4
Sorry when you say native versus Java what do you mean? As far as I was
concerned all native apps are java?

~~~
girvo
Native machine code, he means, rather than "native to Android" Java bytecode.

------
mfkp
"RubyMotion for Android features a completely new Ruby runtime specifically
designed and implemented for Android development."

That is huge, very excited to check this out!

I would love being able to write ruby instead of java (whereas objc doesn't
bother me that much).

~~~
infraruby
> I would love being able to write ruby instead of java

You can do that with InfraRuby
([http://infraruby.com/](http://infraruby.com/)) if you don't mind writing
type annotations.

~~~
infraruby
Thanks for the downvotes! In case it's not obvious, this is a free download
(follow the "Installation" link). A major update will be released next week!

InfraRuby compiles Ruby with type annotations to ordinary Java classfiles.

~~~
wukerplank
Wow, that is well hidden. Also: I don't get "Live" form. Wouldn't a "hey you
wrote Ruby, but here is your .jar" form make more sense?

------
scoot
I just wish they'd release an LOC limited trial version. I'd love to give it a
spin, but I'm not about to fork out that much money just to try it...

~~~
Karunamon
Likewise. $200 is a lot of money to throw down on something sight unseen,
money back guarantees or otherwise.

~~~
donw
I disagree.

Somebody that doesn't want to spend $200 on a product with a complete-
satisfaction guarantee probably won't be a very good long-term customer. The
RubyMotion guys are filtering out the low-end of the market, which from a
business perspective, is a good move.

~~~
Karunamon
Um.. no. Sorry. I haven't done that for desktop software since the early
2000s. You're asking for a lot of damn money on nothing but faith.

Besides, every crappy product advertised on TV ever offers a "money back
guarantee", and some cursory googling should show that those often aren't
worth the electrons used to transmit the image to the screen.

This is the internet age, and we're talking about software. You get paid
_after_ I see what you're selling, and not before. Code samples and writeups
are nice, but it's no substitute for getting one's hands on the tool.

I'd also like to call out the rather annoying trend of any criticism of
pricing being met with the "keeping out the low end market" dismissal.
Sometimes, your product is just overpriced and your sales methods leave a lot
to be desired.

~~~
venus
I have to say I have trouble taking comments like this seriously. $200 is "a
lot of damn money"? Are you kidding? This is a professional tool for software
developers. You do know you'll need a $100/yr ADC membership to even run your
software on an iOS device, right?

Many developers have no problem whatsoever spending $200 on a tool like
rubymotion, in fact I think it's a bargain. A money back guarantee is a bonus,
and no-one has any reasonable doubt as to its legitimacy. I agree completely
with the GP that this makes good business sense.

~~~
Karunamon
I'm glad you have the disposable income to spend on something without even
knowing in advance if it's something you'll use or even like.

I do not. But apparently personal principles are unwelcome here.

------
lnanek2
I was impressed that even with all this translation and Java compatibility
going on, the sample code still shows some situations where the nice clean,
concise nature of Ruby is still up and running. E.g.:

> @paths.each { |path, paint| canvas.drawPath(path, paint) } if @paths

From:
[https://github.com/HipByte/RubyMotionSamples/blob/master/and...](https://github.com/HipByte/RubyMotionSamples/blob/master/android/Paint/app/main_activity.rb)

And: @activity.handler.post -> { @activity.updateTimer }

From:
[https://github.com/HipByte/RubyMotionSamples/blob/master/and...](https://github.com/HipByte/RubyMotionSamples/blob/master/android/Timer/app/main_activity.rb)

These things take a lot of lines in Java for Android where we don't have
lambdas and function references yet and often have to define anonymous classes
just to pass a method in to a handle to be run later.

------
crashandburn4
I was just looking at the rubymotion licences [0]. does anyone know if you
will get future releases with the licence? do you only get them for one year?

[0]
[http://sites.fastspring.com/hipbyte/product/rubymotion](http://sites.fastspring.com/hipbyte/product/rubymotion)

~~~
ptomato
> does anyone know if you will get future releases with the licence?

Yes.

> do you only get them for one year?

Yes, though license renewal costs $100, not $200.

~~~
jamon51
Actually, the license is good forever. The $100 is for updates and support.

------
sciguy77
I am elated. Rubymotion is awesome. It has the ease of PhoneGap with the speed
of native Obj-C.

~~~
stephenhuey
I just downloaded it and am impressed so far. Looks like it'll be an extra
bonus since I won't have to also learn Ruboto to write Android apps with Ruby.

------
yulaow
Surely today with this news, the one on xamarin and that on codenameone it is
likey orgasm-day for all the crossplatform tools lovers.

------
mark_l_watson
Does anyone know if the RubyMotion price of $200 will include Android support,
or will that be a separate product?

~~~
blacktulip
It is most likely all included in one product. If it is a separate product it
would not use --template `motion create --template=android Hello`

------
octopus
This is great news, it will boost the adoption of Ruby and RubyMotion in the
huge Android market.

Finally I have a reason to give RubyMotion a try. I'm curious how much
productivity gain can one achieve with a language like Ruby once it is
compiled (which will ensure the speed of the resulting application).

~~~
colinta
I think the gains are huge, but it depends on your preferred workflow. I know
some traditional Xcode developers who kick and scream at the idea of loosing
their IDE, whereas I prefer to live in the terminal.

Workflow is one thing, but then writing Ruby code is so _fluid_. Notice that
there's not a lot of preamble (imports and such) that you need to take care of
in the Ruby code, I think that's great. But, again, language and workflow are
very personal, and I think every tends to "think they're right" ;-)

~~~
octopus
Agreed, RubyMotion is appealing if you prefer a fast development cycle. I tend
to use C++ for most of my programming projects but every time I've used a more
"dynamic" language (Python or JavaScript in my case) I was amazed at how fast
I can try/drop/improve on an idea and see the code running. The only problem I
had with the "dynamic" languages was the speed of the resulting code,
RubyMotion seems to be in the sweet spot between a statically typed language
and a dynamic (usually interpreted) language.

------
rahilsondhi
Are mobile apps written with RubyMotion on par with the native equivalent? For
example, I've heard a lot of people dislike PhoneGap, AppAccelerator, etc
because the final app isn't as polished as something that is built natively.

~~~
cmelbye
Yes, it says that in the announcement:

> The object model of RubyMotion for Android is based on Java. Ruby classes,
> objects, methods and exceptions are Java classes, objects, methods and
> exceptions, and vice-versa. No bridge is involved.

You're still coding to the same native APIs, but you're doing it in Ruby.
That's how RubyMotion works on iOS/OSX as well as Android now.

~~~
rahilsondhi
Very nice, thanks!

------
Karunamon
Some code samples already available on Github:
[https://github.com/HipByte/RubyMotionSamples/tree/master/and...](https://github.com/HipByte/RubyMotionSamples/tree/master/android)

------
dimillian
Hey, when it comes to mobile, I develop them in pure Objective-c for iOS, and
pure Java for Android. I use tools provided by both compagnies. So yeah, I do
the jobs twice, but I think it's ok.

Anyone have feedbacks coming from what I do to something like RubyMotion or
Xamarin? These solutions sound very interesting, but I've yet to try them. I
think I'm too attached to my Objective-c and workflow.

Also, is there peoples who originally used RubyMotion or Xamarin and went to
use OC and Java?

~~~
colinta
If you already have a comfortable work flow, I would not encourage you to
migrate just for the sake of it, but having the option to write a native app
in Ruby is very compelling to a lot of people who might otherwise not be
interested in writing a native mobile app.

RubyMotion supports xib files, storyboards, xcdatamodel files, and Android XML
files (and localization files, etc), so if you ARE interested in switching,
you don't have to stop using those if you're already used to them.

------
higherpurpose
Is there something similar for other languages?

~~~
wukix
[https://wukix.com/mocl](https://wukix.com/mocl) (for Lisp)

------
dgregd
BTW is there something like PhoneGap but for desktops (Win, Linux, OSX)? Or
even better, Ruby integrated with Webkit.

~~~
suchabag
I've used a bit TideSDK [1]. I'm afraid the project might be on hold though
since there has been no activity on their github repository [2]. Some
explanations can be found on their blog [3]

[1] [http://www.tidesdk.org/](http://www.tidesdk.org/) [2]
[https://github.com/TideSDK/TideSDK](https://github.com/TideSDK/TideSDK) [3]
[http://www.tidesdk.org/blog/](http://www.tidesdk.org/blog/)

------
fuddle
I'm curious if the XML views will remain the same?

~~~
chrisdevereux
Presumably yes if it uses native APIs. On iOS, although .nib files are
supported, people tend to prefer Ruby DSLs to define interfaces though. I
imagine that something similar will happen on Android.

Expect that it won't be long before somebody comes out with a cross-platform
wrapper for native UI elements similar to Xamarin 3.0.

------
gary4gar
does this work on all android versions?

------
mmanfrin
Pretty damn cool.

------
andyl
This is fantastic news. I love RubyMotion and can't wait to try it on Android.
Especially want to learn how easy it will be to create wrapper objects to have
a common API across platforms.

