Samstag, 7. November 2015

RoboVM - way to write cross-platform mobile apps on Java

This weekend I spent some time participating in RoboVM Pull Request contest. Guys from RoboVM prepared demo application and invited people to add new features.

Amongst proposed features to add were:

  • commercial transactions support
  • localisation
  • everything else you can imagine :)

Because I had almost no previous mobile development experience I decided to start with some simple thing.

Typical RoboVM mobile project consists from 3 modules:

  • core - which shares code between platforms
  • android - platform specific UI implementation for Android
  • ios - platform specific UI implementation for iOS

For long time I wanted to give a try to Paypal Java SDK. That was a chance.

Because I wanted to use it for both platforms (iOS and Android) library dependency should be included to core module. Project uses Gradle as a build tool and all you need to do is include following line to build.gradle:
compile 'com.paypal.sdk:rest-api-sdk:1.2.9'
At first I started with simple implementation of payment API (PaymentAPI). I following this reference. Tried following sample requests against my test account. Everything worked perfectly!

Android UI is organised in fragments. I added new one (PaymentDetailsFragment) and changed a bit logic of working with order placement.

That was a pleasure to work with new RoboVM Studio. Most of functions I used to have in JetBrais Idea I had as well because it is just fork of Community Edition.

If you are reading this text before 23rd November 2015 you still have a chance to win one of the prices provided for that RoboVM contest.