8 Replies Latest reply on Jan 25, 2017 1:16 PM by TAU TECHNOLOGIES

    Android native exnension using callbacks in RMS 4.1

    Krystian Sikora

      I'm developing an android extension using 3rd party library for communicating with chip & pin device.

      I've managed to connect to symulator device and to receive events from device in java code.

       

      Now I need these events to be fired in ruby/javascript and my idea is to implement it via callback to ruby view.

       

      What I've done is to use native callback java method from com.rhomobile.rhodes.camera.Camera; by actually removing the method from Camera.Picture private class and moving it to Camera class directly.

       

      Then I can import the Camera class and use it as following:

       

      import com.rhomobile.rhodes.camera.Camera;

       

      ... some class declarations and methods...

       

      Camera.callback(this.callbackUrl, "event=endOfTransaction&status=authorised");

       

      and everything works as expected.

       

      I've achieved that by changing open source part of Rhodes, more precisely the Camera class. Can you help me in achieving the same functionality without changing the rhodes sources?

       

      Best regards,

      Krystian Sikora