Skip navigation links

Package remoter.annotations

Remoter is an alternative to Android AIDL for Android Remote IPC services using plain java interfaces.

See: Description

Package remoter.annotations Description

Remoter is an alternative to Android AIDL for Android Remote IPC services using plain java interfaces.



Example -


 //Remoter annotation marks this interface as a remoter service interface
  @Remoter
  public interface ISampleService {

      //An example where parameters can be in, out or inout
      void boolean foo( boolean a,
                       @ParamIn boolean[] arrayIn,
                       @ParamOut boolean[] arrayOut,
                       boolean[] arrayInOut);

      //An example to mark a method as oneway asynchronous method
       @Oneway
      void asynchronusFoo(int x);
 }
 

At the client side :

Simply wrap the binder that you got from the ServiceConnection with the autogenerated Proxy for your interface


     ISampleService sampleService = new ISampleService_Proxy( binder );


At the service side :

Wrap the implementation with the autogenerated Stub to covert it as a remote Binder and return that from your service


     Binder binder = new ISampleService_Stub( sampleServiceImpl );


To add Remoter to your project add these to its gradle dependencies:
api 'com.josesamuel:remoter-annotations:1.1.4'
annotationProcessor 'com.josesamuel:remoter:1.1.4'


Skip navigation links