Server-Side Apps with access to device functionality aka. accessing the iOS Geolocation API with Java.
Whenever we talk about server-side apps and RAP mobile, one topic always comes up: how to access native functionality like Geolocation or the Camera. With this post I want to show you how we access this functionality on the server-side. At writing, we’ve implemented Geolocation Support, and more additions are planned for the near future.
I have to point out one thing first. When you take look at RAP mobile from a very abstract view, it is nothing more than an object synchronization mechanism. That is, if a button (or any other widget) is created on the server it also needs to be created on the client. This is exactly the same for native functionality. When the server needs the location of the client it has to tell the client that it needs the location. Then, the client has to tell the server the location and this cycle starts over again. The challenge in this approach is to hook the location to the right session. Fortunately, RAP’s server side has solved these issues a long time ago, and it’s pretty easy to hook this information together.
We have created a demo for the Location API, which you can see in the videos linked below. The source code for this demo is also located on github. To conclude, I can proudly say that with RAP mobile it’s now possible to access the Geolocation API of iOS and Android from Java by writing the code only once!
[vimeo https://vimeo.com/40075832 w=500&h=400]
[vimeo https://vimeo.com/40080775 w=500&h=400]