back to article Google offers tool to bridge Android and iOS app dev

Google has released a tool aimed at making it easier to port software between the two major smartphone platforms, by converting Java code for Android into Objective-C code that can be compiled to run on Apple iOS devices. "J2ObjC is not a Java emulator," writes Google's Tom Ball in a post announcing the tool, "but instead …

COMMENTS

This topic is closed for new posts.
  1. Anonymous Coward
    Anonymous Coward

    That's one way of doing it.

    Another is to use Unity, which lets you code in C# or Javascript, and publish your code to Windows, OSX, Linux, Android, iOS, the Web and soon Windows Phone 8.

    Admittedly anything outside the provided class libraries is interpreted, but that doesn't seem to cause any problems that I've noticed.

    1. Anonymous Coward
      Anonymous Coward

      Re: That's one way of doing it.

      Is that the Unity 3D game engine thing (http://unity3d.com/unity/engine/programming)? Only reason I ask is because at first glance to a C# programmer "Unity" brings to mind the IoC container that Microsoft created : http://msdn.microsoft.com/en-us/library/ff649564.aspx

      What's your feeling on Xamarin's toolset (Mono/MonoTouch?)

    2. Ilgaz

      Re: That's one way of doing it.

      I got over 170 apps installed on Android and the only weird working app is coded with that Mono junk.

      1. sabroni Silver badge

        Re: Mono junk.

        shit code is language agnostic.

  2. jake Silver badge

    ::rubs chin:: What's the word I'm looking for?

    Oh, yes, that's the one: "clusterfuck".

  3. Anonymous Coward
    Anonymous Coward

    I give the iPhone another 3 years tops

    soon people are going to wonder why they ever thought it was good

    1. Anonymous Coward
      Anonymous Coward

      Re: I give the iPhone another 3 years tops

      Same for Android. With Apple barely innovating that only really leaves Microsoft or RIM to come up with new ideas.

      Who are Google going to borrow ideas of? there's practically nothing original in Android.

      1. JDX Gold badge

        Re: I give the iPhone another 3 years tops

        Good counter-troll.

      2. Kwac
        Trollface

        Re: I give the iPhone another 3 years tops

        have Apple ever done anything but 'barely innovate'?

        1. Anonymous Coward
          Anonymous Coward

          Re: I give the iPhone another 3 years tops

          I dont know, they have done a good line in questionable patents

        2. Anonymous Coward
          Anonymous Coward

          Re: I give the iPhone another 3 years tops

          "have Apple ever done anything but 'barely innovate'?"

          In my view? Yes, Steve Jobs seems to have been the first computer entrepreneur to realise that computers only looked complicated to adults, but wee boys/girls got along just fine with them, thus shaping his vision of things to come, and most notably, giving him the confidence that yes, the computer as a consumer item did indeed have a future.

          Granted, that was a few decades ago when many of the people commenting here weren't even born, but if nothing else in at least that sense I believe the Macintosh *was* innovative. People familiar with Apple may be able to bring up more recent examples.

          Btw, I have never bought any Apple products or services that I'm aware of, and don't know much about the company itself, but, with due respect, those accusations that "$leadingITCompany has never done anything innovative" ring a bit silly to me.

    2. Ken Hagan Gold badge

      Re: I give the iPhone another 3 years tops

      That would have given it about a decade at the top of its market, so even if you are right I doubt that Apple will reckon it was a failure.

      So what's coming in 2015 that completely changes the market for "personal gizmo"? Goggles? (Quick! Somebody trademark iPatch and iWear.)

  4. Julian C
    Holmes

    Won't last long?

    Is my memory faulty or do I recall Apple closing off apps developed using cross-platform tools from the apps store a few years back? Must be some fingerprint in code generated this way that they'll spot and close off too.

    TBH I'd be more impressed if developers for the minority platform got such a tool rather than the other way round... ;-)

    1. JDX Gold badge

      Re: Won't last long?

      No they allowed it in the end.

      1. Barry Dingle

        Re: Won't last long?

        Which end?

  5. JDX Gold badge

    It's A solution

    Or you could write your app in cross-platform C++ (don't know if there are any good cross platform MOBILE UI toolkits though, like wxWidgets for Windows/Linux/Mac).

    1. Richard 12 Silver badge

      Re: It's A solution

      There is, it's called Qt.

      Unfortunately an idiot by the name of Elop didn't understand what he had and threw it away.

      It's now managed by Digia.

      It currently handles Android, Symbian, Mac OSX, Windows, Linux (many platforms) and a lot of more specialised targets.

      I believe that an iOS target is under development, though I don't know how far away.

      WP7 & 8 are not currently on the table, which is rather strange.

      1. Mike Judge
        Stop

        Re: It's A solution

        Not really that strange considering nobody bought windows phone

    2. Mr Woof
      Boffin

      Re: It's A solution

      I've been using Marmalade (previously known as AirPlay) for a few years to write games in C++ for iOS and Android (and Windows and OS X and Playbook and Bada and so on). The UI stuff is not so hot (it does have cross platform native UI support but it's pretty limited) but, bugs aside, the rest is pretty nice (integration with either GCC or RVCT ARM compilers under VisualStudio, STL, OpenGL or an abstracted 2D and 3D APIs with a choice of backends, etc., etc.). Works with Xcode too if that's your thing ('thing' in this particular case being that you hate yourself).

  6. Anonymous Coward
    Anonymous Coward

    Surely they're going the wrong way. With far more apps written, and being written for iOS, shouldn't they be making easier to port apps to the Android

    1. Richard 12 Silver badge

      Google want devs to write the Android first

      They are saying "Here, write your application for Android and you can easily port it to iOS in the future."

      The idea is that development houses will start by writing an Android app, as that way around carries less risk.

      It's also pretty likely that many will never actually convert it to iOS at all, merely having the option is enough.

      If you only develop for iOS it's pretty risky, as you're screwed if/when iPhone popularity dips*, and indeed vice-versa.

      *It will probably dip fairly soon, because iOS is starting to stagnate - what's new in iOS 6? An extra screen size?

      1. Anonymous Coward
        Anonymous Coward

        Re: Google want devs to write the Android first

        How does developing for Android carry less risk when apps are selling better for iOS?A larger user base doesn't equate to bigger sales.

        Didn't the last survey say there was a decline in the number of people developing for Android? Surely a tool that makes it easier to port the app they're currently writing to Android makes more sense.

        1. Richard 12 Silver badge
          FAIL

          *Whoosh* as the point flies over your head

          Which is riskier - developing for both of the two most popular platforms, or developing only for the second-most popular platform?

          Of course, neither are as risky as developing for the fourth or fifth (depending on how it's measured) that hasn't even been released yet.

          1. QuinnDexter

            Re: *Whoosh* as the point flies over your head

            @Richard12

            I completely agree. Have Google done this to make sure a competitor benefits? No. They haven't spent a fortune developing this for others, it's because they need it for their benefit.

          2. Anonymous Coward
            Anonymous Coward

            Re: *Whoosh* as the point flies over your head

            *Whoosh* as the point flies over YOUR head.

            Why develop FIRST for the platform that will make you less money. Why not develop for iOS to generate money to fund your Android development. What about all the iOS apps that have already been developed too? Why not make a tool that would ease porting them.

            Surely that tool only benefits Google?

            1. Richard 12 Silver badge
              FAIL

              Re: *Whoosh* as the point flies over your head

              Oh dear. You really don't get it, do you?

              Google wrote this tool. Google want people to develop for Android, and Google would prefer that people did not develop for iOS.

              Ask yourself this question:

              Which of these statements are in Google's interest to say:

              a) "Develop Android first, and you can make an iOS version easily."

              b) "Develop iOS first, you can make an Android version easily."

              Hint - if you said, (b), you're wrong.

              1. Anonymous Coward
                Anonymous Coward

                Re: *Whoosh* as the point flies over your head

                Oh dear. You really don't get it, do you?

                Google wrote this tool. Google want people to develop for Android, and Google would prefer that people did not develop for iOS. So writing a tool that ports Android code to iOS would be crazy!

                Ask yourself this question:

                Which of these statements are in Google's interest to say:

                a) "More people write for iOS. Let's make a tool that makes it easy for people to port their apps to Android."

                b) "More people write for iOS. Let's make a tool that makes it easy for people to port Android apps to iOS too"

                Hint - if you said, (b), you're wrong.

                1. Ramazan
                  WTF?

                  @AC

                  What you've just said proves that Google's intentions are not that obvious as you are. Google doesn't care about developers or iOS users. Developing in java2objc fashion means that Android apps would work OK but iOS ports would be terrible without extensive manual tuning (BTS, have you ever tried to find errors in autoconf-generated ./configure scripts)? Then users would grow frustrated with inferior iOS versions of apps and developers would grow frustrated with fixing and patching the inferior iOS versions of their apps, and voila, profit!

                  If Google's gnomes really wanted to help anyone besides themselves, they'd develop two-way java <==> objc converter

                  1. Anonymous Coward
                    Anonymous Coward

                    Re: @AC

                    @Ramazan

                    Ah, finally a sensible comment. I guess I was a bit naive to think Google were actually trying to help developers with this tool.

    2. P. Lee
      Holmes

      >shouldn't they be making easier to port apps to the Android

      Absolutely not.

      Otherwise people will code for your competitor and you'll get the second rate port. Remember OS/2 & NT?

  7. Archibald Trumpetbeetle
    Thumb Up

    I was thinking of writing a tool

    for writing common non-UI code with a series of elegant C pre-processor macros. I'd write code in the macro language, and then I'd have a different set of macro definitions for each target language. It would have been AMAZING.

    1. Toothpick
      Go

      Re: I was thinking of writing a tool

      Don't forget to patent it

  8. David Given
    Go

    Or, C++

    If anyone's interested, I have a rather prototype Java to C++ translator: https://chiselapp.com/user/dg/repository/cowjac/home

    It works well enough to run benchmarks but is decidedly unfinished. I'm taking a rather different approach to Google --- I'm starting with Java bytecode, while they're starting with Java source. I'd hazard that mine is theoretically capable of producing better code (as I'm using a proper Java compiler/analysis framework underneath). OTOH, theirs is actually useful, if that's relevant to anyone...

  9. Nathan 6

    Codename One

    Codename One seems to have a much better tool for doing this, or they will once the program matures.

    http://www.codenameone.com/

  10. toadwarrior
    Trollface

    This is something numerous people have already worked on. So it appears to be Google "borrowing" ideas for Android again.

    1. Anonymous Coward
      Anonymous Coward

      "So it appears to be Google "borrowing" ideas for Android again."

      Umm, it's for iOS really as that is what it translates Android code too. If you're going to troll, at least do it accurately.

  11. Sean Baggaley 1
    FAIL

    So let me get this straight...

    ... I'm supposed to lead on the platform with the worse ROI, using Java? (You know: the language currently most famous for its "write once, malware everywhere" philosophy?)

    I think I'll pass, thanks.

    1. Ben Tasker

      Re: So let me get this straight...

      Well, yes. It's not exactly in Google's interests to say "Develop for iOS and then use our tool to port to Android" is it? If the tool chucks out some dodgy code, it's iOS that'll be seeing that which probably suits Google quite well.

      For some it'll be incredibly useful, for others not so much. Apple may currently have a better ROI, but are we sure it's going to stay that way? If iOS sales were overtaken by Android, would you prefer (as someone pointed out above) to be developing for the second most popular platform, or for the top two?

      Of course it could be that Windows P.... nope can't finish that sentence, never going to happen.

      I do prefer WOMA to WORA actually (the term, not the effect!) as let's be honest, WOMA is far, far more true than WORA ever actually was.

    2. Anonymous Coward
      Anonymous Coward

      Re: So let me get this straight...

      With that attitude, I'm guessing you only develop for iOS and wouldn't develop for another platform unless poked with a sharp stick so I'll ignore your childish "malware everywhere" comment.

      Even if you open your mind just a little, you should be able to see the benefits of this, even just to your little iOS world: there are millions of libraries written in Java - how many in Objective-C? If those Java libraries are pure-Java and if this converter is good enough, they can now also be used in iOS.

      1. Ramazan

        Re: there are millions of libraries written in Java

        prove your point -- start counting

      2. Anonymous Coward
        Anonymous Coward

        Re: So let me get this straight...

        "there are millions of libraries written in Java - how many in Objective-C?"

        But how many in C and C++ all of which can be linked against Objective-C?

  12. airbrush
    Thumb Up

    Its funny when ms write a development tool they seem to spend more time making sure it isn't cross platform, they'll know they've arrived when google adds c# as an option.

    1. John Styles

      You are being slightly unfair

      What they have done in the past with cross platform tools has been rather more ingenious

      See http://en.wikipedia.org/wiki/Bristol_Technology_Inc.

      http://en.wikipedia.org/wiki/Windows_Interface_Source_Environment#Unfair_use_of_Microsoft_dominant_position

  13. Anonymous Coward
    Anonymous Coward

    It is not banned yet!

    Obviously by the time you have ported your app Apple will almost certainly have banned the use of this open computing tool.

    Considerinh that Adobe surely had to kill future Flash on Android in order to keep their tools working at Apple.

    However, if Google cripple Android to become more IOS like then Apple may play ball.

    1. Anonymous Coward
      Anonymous Coward

      Re: It is not banned yet!

      They can't ban this, this doesn't make/convert applications. It converts part of your code which you can then re-use when building your iOS application. You still need to build the iOS UI and compile as normal. This just saves duplicating code in two different languages. At least that is the goal.

      1. Anonymous Coward
        Anonymous Coward

        Re: It is not banned yet!

        They can ban whatever they like; it's their store and they're a pack of bastards.

  14. DrXym

    This is only half the story

    Being able to convert code to Obj C is great and all, but if I write an Android app I have activities, intents, resources, layouts and so on. Or for games they might be using OpenGL ES through Java bindings. Most of the application layer is almost certainly heavily tied to Android APIs to some degree or another.

    So the perfect utility would take an app written to Android on one side and spit out the analogous app in Obj C on the other.

    Personally I'd like to see the tool spit out C++ in preference over Obj C at least where possible since then it could be reused on Win8 or RIM too rather than just the iPhone.

  15. Anonymous Coward
    Anonymous Coward

    Smalltalk

    As far as I know you can write an app in Pharo Smalltalk (an actual OOP language) and it'll run on Mac, Windows, Linux, iOS, or Android.

    I've not verified the claim but, if true, it would seem a better solution than one that involves any sort of code translation+fixup.

  16. This post has been deleted by its author

  17. lord_farquaad

    initial version

    "with the initial release given version number 0.8 as an indication of its release status."

    Rather looks like 0.5.2 as far as I can see

This topic is closed for new posts.

Other stories you might like