Tabris 1.0: Cross-platform Mobile Development in Java
After three years in development, EclipseSource has released Tabris 1.0, a cross-platform Java mobile development framework for iOS and Android. Tabris is targeted at enterprises, and unlike other mobile solutions out there it uses a different approach:
- Most of the programming is done in Java
- The business logic including the binary representation of the client UI runs on the server side on Eclipse RAP.
- A very thin client application runs on the mobile device
- The server communicates with the client in JSON format, sending data and commands for creating the visual UI
- The client generates the interface using native components
- The client is written in Objective-C for iOS and Java for Android
Tabris comes with a UI Toolkit built on top of Java SWT API. The toolkit adds two main widgets: Page and Action. Page contains the basic content of an application while Action is for taking user’s commands. Page is shown in red and Action is shown in green in the following snapshot of a demo Tabris application:
Pages can be chained and navigated, while Actions can be global –for the entire application-, or local – for the current page-.
After processing a component, the server side of the application sends a JSON snippet to the client as the following one used to create a button:
The client app will render the button using iOS or Android native components.
InfoQ has talked to Holger Staudacher, Team Lead for Tabris-server at EclipseSource, to find out more about the framework. According to Staudacher, Tabris is targeted at enterprises and requires a permanent network connection to the server:
Tabris is for On-Site mobility applications. This means it works best in a controlled environment. With controlled I mean a fixed network connection and so on. We have customers e.g. like a hospital where all devices are connected to the same network. Such applications are usually developed by the enterprise.
Tabris does not work offline. A mobile UI is basically a session. So, if the user's device loses connection the session becomes invalid. There is error handling which can be done on the mobile clients. We have implemented standard error handling for retrying sending the http request and so on. But this can be extended by the app developer with native extensions.
When asked if Tabris would make sense for developing applications for the general public, Staudacher said that theoretically it could be done but it is not best fit for that purpose:
To general public means you will create a heavy load on the server. We are using standard Java EE technology there. So, if you have such a heavy load standard Java EE clustering mechanisms can be used. It's not yet tested with millions of users. But from a technical point of view it should be doable ;)
Tabris supports many SWT components and adds support for several native sensors such as camera and geolocation.
Currently, tablets are supported but such an application shows only one page at a time. Support for multiple pages is to be added in the future. Also, Tabris can be extended to other mobile platforms, and Windows will be probably supported if the framework gets traction.
In the near future, the Tabris team intends to add the following functionality:
- Address book support
- Device orientation support
- Client Scripting support for handling client events
- XCallbackUrl support
Tabris is not open sourced but enterprise licensees can get access to the source code. More details can be found on EclipseSource’s pricing page.
What is the point?!
This is why Mono is earning the hearts of the developers doing cross-platform native applications, if companies want to target native, the target should be platform integration and not funny hacks.
Re: What is the point?!
I would not say this is a hack. It is built on the same technology used to create Eclipse RAP and RCP applications. Most client side technology makes you deal with JSON (at the very lest the server communication) directly. Tabris makes is so you don't need to. If that is a hack, I will take it. I have more valuable things to do than dealing with low level issues like JSON parsing, object binding and server communication.
As for Mono, while it is good, I don't see it winning the hearts of [pretty much] anyone outside the C#/Mono world. From what I can tell, most people are doing JS to Native development (or just plain web mobile). Of course you can argue their heart is not in it (mine would not be). Mono might be able to win my heart (1) if I could use Eclipse/NetBeans/IntelliJ, (2) if there was not split tooling and (3) if there was some level of opensource (that is part of what is stopping me for Tabris).
If you want something Java that targets iOS and Android (and soon Windows) without a server dependency, then look at CodeNameOne. Of course, nothing is perfect and they have their own issues.