Showing posts from 2013

IOS Java App (RoboVM) communicating with server (Versile)

Before you continue - check out the demonstration video:

The demonstration uses RoboVM to build an IOS app (written in Java), and Versile to create a server and provide communication between the app and server.

Details of configuring Versile and RoboVM are not described here. Go to RoboVM website, and check my earlier Versile blog posts for more info.

The source for the IOS app is based on the RoboVM example:

import java.util.Date;
import org.robovm.cocoatouch.coregraphics.*;
import org.robovm.cocoatouch.uikit.*;
import org.robovm.objc.block.VoidBlock;
import org.robovm.rt.bro.Bro;
import org.robovm.rt.bro.NativeObject;
import org.robovm.rt.bro.annotation.Bridge;
import org.robovm.rt.bro.annotation.Library;
import org.versile.Versile;
import org.versile.orb.entity.VProxy;
import org.versile.reactor.url.VUrl;
import org.versile.vse.VSEResolver;
import org.versile.vse.util.VFunction;

public class VersileRoboVM extends UIApplicationDelegate.Adapter {


Remote service interaction with Versile and Groovy - Part 2

In the previous post I showed you how to connect two peers using Versile. In this post I'll show how to authenticate the party requesting the connection.

Authentication in Versile is done by checking the public key received from the other party. Both sides can check the identity of the other side. Identity key pairs can be generated using Versile Decentral Identity (VDI), which in many ways is similar to SSH-keygen. Using VDI is as simple as usernames and passwords, but not having to share this with the other party increase security - and the keys can be exchanged privately between the two parties, no certificate authority needs to be involved.

A Versile Decentral Identity can be generated from Groovy/Java as simple as this:

VPrivateCredentials key = new VPrivateCredentials(VDecentralIdentity.dia(1024, 'versilegroovy', 'peter', 'asdfghjkl12345'))

And we can print the public key:
print new String(key.getKeyPair().exportPublicArmoredPkcs())
Resulting in the fol…

Remote service interaction with Versile and Groovy - Part 1

Versile is a compact but powerful technology for remote service interaction. I will write a few blog posts about using this technology with Groovy. In fact the examples presented should be applicable for other JVM scripting languages as well as pure Java - since Versile Java is the only library needed here.

Creating a class which methods can be exposed remotely is easy with Versile. Simply inherit the VExternal class and annotate the methods with the @Publish annotation:

class Svc extends VExternal {
    @Publish(show=true, ctx=false) public String hello(String name) {
return "hello "+name

A few more lines of code is needed to put this service on the air, but before we get to that, I'll show you how to connect to it and call the hello method remotely:

// Get remote object
proxy = VUrl.resolve("vop://localhost/")

// Call method on remote object
print proxy.hello("Peter")

That was easy? To be able to call the service we need to create a listener for VOP …