Writing iPad/iPhone/iPod applications with Java and SWT?

Writing iPad/iPhone/iPod applications with Java and SWT?

The prototype described in this blog became real. Take a look at http://rapmobile.eclipsesource.com for more infromation.

Over the last couple of days, Jordi and I played a little with the Eclipse RAP protocol. We decided to develop a Cocoa Touch client for RAP using the iAd JavaScript library. You can see how it looks in this YouTube video.

Here’s a brief explanation of what’s in the video. We developed a new bundle which contains the iAd JavaScript library. Basically, iAd brings Cocoa Touch widgets into the browser, and we’ve written handlers that create widgets based on this JavaScript library. We could then start a simple RAP application with the iAd bundle and access it with Safari.

The result is just awesome. You can write your UI completely with SWT on the server side and access it with the iPad/iPhone/iPod or with just a webkit based browser. The UI experience feels just like native Cocoa Touch. Eclipse RAP and the RAP protocol makes it possible ;). Please note that this is just a prototype and not yet available for download. But you can check out the RAP protocol using git and develop your own client representation.

18 Comments
  • Posted at 12:48 pm, June 11, 2010

    Wow just wow this look great, Im hoping this will be the way to go with Rap 1.4 :). I am also guessing that the communication between the clients is less intensive then the normal situation?

  • Posted at 4:28 pm, June 11, 2010

    wow – this is really cool
    ekke

  • sharad
    Reply
    Posted at 7:50 pm, June 11, 2010

    WOW 🙂 really good technology for product based companies

  • Tom Bauwens
    Reply
    Posted at 10:13 am, June 12, 2010

    Very nice indeed! With Eclipse RCP/RAP, desktop app? no problem. RIA? no prob. iPhone? no prob. Oh, and from single source 🙂

  • Dimitris
    Reply
    Posted at 12:33 pm, June 12, 2010

    I am a *big* eclipse (and SWT) fan! However this is 2010, 21 century. Are we still getting excited with buttons, check-boxes and yet-another cross platform toolkit, framework, whatever? I started practicing Objective-C sometime ago IMHO it is way more exciting than this. Moreover I think that there is no way to avoid it if you are serious about developing iphone apps.

  • Michael
    Reply
    Posted at 12:53 am, June 13, 2010

    I thought steve banned this?

  • Luís Carlos Moreira da Costa
    Reply
    Posted at 4:16 pm, June 21, 2010

    @Excellent!

  • Ivan
    Reply
    Posted at 12:02 am, June 25, 2010

    means…. we can’t use this to write an offline apps, right ?…

  • Ivan Maidanski
    Reply
    Posted at 10:12 am, July 18, 2010

    Another way to develop in Java for iPhone/iPad is to translate Java application to C by some tool (e.g., JCGO). But the question is: SWT supports Cocoa on Mac OS X, is it hard to port SWT to iPhone/iPad?

  • Posted at 8:43 am, October 23, 2010

    Hello. I am looking for someone who can take a digital game written using Java and make it playable on the iPad.
    Please email me at: jklamer@att.net if you might be of assistance. Thank you.

  • Posted at 4:18 pm, December 6, 2010

    I tried to download the source. I copied the plug-ins from the runtime.rwt folder into my workspace and removed the original ones from my run configuration. There were around 4 compile errors but i tried to fix them by adding a few methods to the ITreeAdapter interface and implement them (without understanding the logic in them completely though).
    Sadly i end up with something like this:
    “Could not evaluate javascript response:

    SyntaxError: illegal character

    ###BEGIN_JSON###
    {
    …;org.eclipse.swt.Request.getInstance().setTimeoutPage( ”

    The server session timed out.

    Please click here to restart the session.
    ” );var wm….”

    Have you got any ideas on what could be missing?

  • Posted at 7:12 pm, December 8, 2010

    Awesome. Can’t wait to port my SWT APP to smartphone and tablets.

  • Xingxiao.lu
    Reply
    Posted at 8:30 am, December 31, 2010

    I tried to download the source, and got the exception too:

    SyntaxError: illegal character

    ###BEGIN_JSON###
    {
    …;org.eclipse.swt.Request.getInstance().setTimeoutPage( ”

    The server session timed out.

    Please click here to restart the session.
    ” );var wm….”

  • Dave Henderson
    Reply
    Posted at 9:34 am, February 21, 2011

    Does this have an advantage over using the GWT to generate HTML etc. from java?

  • Posted at 8:17 pm, April 16, 2011

    I try that few months back but not succesful. Now after reading this i have a hope again.

  • anonymous coward
    Reply
    Posted at 4:25 am, June 3, 2011

    Java or JavaScript? They are two very different things.

Post a Comment

Comment
Name
Email
Website