Errai: The browser as a platform

Tuesday, January 8, 2013

Mobile Errai

Creating an application for mobile is challenging and GWT is very good to use in this space, because it optimises for the browser and keeps the downloads small. But still there is this big initial download that users of your application need to do (all the html and javascript). Also if you are going to create a mobile application you want to be able to use the additional features that a phone has, in a convenient way.
This is where Errai-Cordova comes in. As you can get from the name it uses Cordova to create an application that can be installed easily on mobile devices. Cordova is like a little web server and a web browser bundled into a mobile app. So now, when your application gets installed, the user will already have all of your front-end. To be able to use your backend you'll have to do some configuration.
In the class org.jboss.errai.example.client.local.Config you need to specify the address of your backend server like so:
Now you can create some responsive html and have it behave nicely on differently sized devices. I'm not that good in designing something that looks very nice, but there are some really nice things that you can make. Take a look at 2012.inspireconf.com and make your browser window smaller to simulate looking at this site with a phone or a tablet.
Finally using the capabilities of the phone, like the camera or accelerometer, you can inject them in a true errai fashion.

Take a look at the demo project on github for a working example.
This is the sneak peak of what's to come, hope you like it!

1 comment:

  1. Mobile applications are more popular and to making mobile application according to customer is challenging job.
    best spy mobiles apps

    ReplyDelete