Git Product home page Git Product logo

remoter's People

Contributors

f43nd1r avatar josesamuel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remoter's Issues

package org.parceler does not exist

Hi! Great library.

Just encountered this issue when using remoter for a kotlin interface. I included the library using a kapt annotation processor:

implementation 'com.josesamuel:remoter-annotations:1.2.4'
kapt 'com.josesamuel:remoter:1.2.4'

The annotation processor runs correctly and generates my proxy and stub, but at compile time throws the error package org.parceler does not exist whenever the generated stub tries to call org.parceler.Parcels.wrap().

Adding the following to my build.gradle works around the issue, but shouldn't Parceler be a transitive dependency?

implementation 'org.parceler:parceler-api:1.1.12'
kapt 'org.parceler:parceler:1.1.12'

Unchecked Exception is swallowed on oneway communication

Issue description

Lets assume we two apps, one acts as Server and the other acts as Client for a IPC Oneway call.
Now the Client performs a Oneway IPC call which includes a callback to the Server. The Server tries to process the request and suddenly produces a unchecked exception (OutOfMemory...). The Remoter Framework is now swallowing the unchecked Exception and the Client still waits for the callback to be called.

Steps to reproduce the issue

  1. Client calls Server via Oneway call
  2. Server produces unchecked exception
  3. Remoter swallows exception and Server continues

What's the expected result?

Unchecked exception in case of a IPC oneway call should be thrown which leads to the death of the App.

What's the actual result?

We had a OutOfMemory on the Server side and remoter was the cause that Android wasn't restarting our App because the OutOfMemory wasn't propagated any further. Instead the App got stuck in a unusable state.

Accessing AIDL file

Is it possible to access the AIDL file that remoter generates from my kotlin interface?

I would like to have access to it so that I can feed it into the Xamarin Android AIDL compiler so that I can have the service be implemented in C#.

Allow code generation for foreign interfaces.

I have a multiplatform project (desktop and android) with a hierarchy of modules.

at the base is a plain Java library written in Kotlin. (:businesslogic)
It contains an interface definition. (IBusinessLogic)

I then have an android library module that depends on this .jar, (:businesslogic:android) where I need to create a remoter host service and a client for this interface.

I can add com.josesamuel:remoter-annotations to the Java Library module (:businesslogic) and annotate the interface, but since it is a pure java library with no Android dependency (it produces a .jar, not an .aar) I cannot add com.josesamuel:remoter-builder and have a remoter stub or proxy generated in that module.

I would like to keep the interface defined in the Java module (:businesslogic) so as to have all the business logic separate from the android platform.

would it be possible to add some kind of mechanism to have the remoter-builder generate an implementation for the interface (IBusinessLogic) in the android module? (:businesslogic:android) while keeping the interface in the java module? Perhaps this could apply to any interface, not just ones that are marked with @Remoter?

perhaps something like the marker you have in your suspender library?

@GenerateRemoterFor(classesToWrap = [
    IBusinessLogic::class, 
    IThirdPartyLibraryInterface::class
])
interface XXX

Does not work w/ Parcelize

Parcelize itself does not generate an accessible CREATOR or writeToParcel in kotlin. For the CREATOR, technically you can create a java helper method to access the CREATOR accessible from the java side, however, I need to look further into the writeToParcel side.

How to call setStubProxyCheck on a listener.

Hi came across an issues. I am testing your library for communication between 2 different apps and at one point I have added extra methods to my listener on de server app and notice the crash because client app had the old version of the listener.

I cannot seem to find how to get instance of each listener as _stub and set setStubProxyCheck(false) on them.

As in your examples I have registerListener(listener: IRemoteServiceListener) Remoter interface implementation.

Where would get access to instance of IRemoteServiceListener_Stub?

Communication between 2 apps

Hi, thank you for great work. I was wondering how one would go about having 2 apps communicating with your library.
You samples seems to show only within communication within app on a different process.

I am trying to have 2 apps, signed with same signature one as server and another as client communication with remoter.
Is it possible at all?

issue with generic interface inheritance

Dear @josesamuel,

Thank you for this great library !

I've faced to some build issue with remoter code generation while trying to create some remote interface inheriting some generic interface.

Here is a trivial code example bringing out the issue:

package example;

import java.util.List;

public interface GenericInterface<T extends List<?>> {

    void onNext(T list);
}
package example;

import java.util.ArrayList;

import remoter.annotations.Remoter;

@Remoter
public interface RemoteInterface extends GenericInterface<ArrayList<?>> {
}

Trying to compile those to files results in following error in generated RemoteInterface_Proxy.java:

error: cannot find symbol
  public void onNext(T list_0) {
                     ^
  symbol:   class T
  location: class RemoteInterface_Proxy

It looks like the T generic parameter is not replaced with ArrayList<?> in Proxy class.

I've specified an upper bounded-type List<?> to simplify the example but actually in my real code the upper bounded-type is a remoter interface. This means that I would expect the generated proxy code to deal with this and work with binder in the remote procedure onNext rather than trying to serialize the input parameter.

I'm not familiar with java annotation processor but I can try to give a hand to fix this, if needed.

Best Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.