xamarin.android using .AIDL - proxy does not fire

Massimo Martino 1 Reputation point
2022-11-15T14:59:42.533+00:00

Hi,
I'm trying to integrate Viva Wallet payment platform into my xamarin.android application
I have successfully imported and compiled the .AIDL file
(https://developer.vivawallet.com/apis-for-point-of-sale/card-terminals-devices/sdks/vw-one-sdk/)

Everything seems to work fine except that the proxy interface is not activated.
Thanks in advance to anyone who can help me.

Here are some pieces of code I use:

protected override void OnCreate(Bundle savedInstanceState)
{
//Binding service
_serviceCiontekPosServiceConnection = new CiontekPosServiceConnection(this);
Intent serviceToStart = new Intent(this,typeof(CiontekPosService));
BindService(serviceToStart,_serviceCiontekPosServiceConnection,Bind.AutoCreate);

base.OnCreate(savedInstanceState);  
Forms.Init(this, savedInstanceState);  
LoadApplication(new App());  

}

public static Com.Ciontek.Ciontekposservice.ICiontekPosService AsInterface (global::Android.OS.IBinder obj)
{
if (obj == null)
return null;
var iin = (global::Android.OS.IInterface)obj.QueryLocalInterface(descriptor);
if (iin != null && iin is Com.Ciontek.Ciontekposservice.ICiontekPosService)
return (Com.Ciontek.Ciontekposservice.ICiontekPosService)iin;
return new Proxy (obj); //>>>>>>> DOES NOT FIRE
}

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Massimo Martino 1 Reputation point
    2022-11-16T07:48:47.317+00:00

    Hi,
    obviously I don't ask for assistance on third-party products, but you assist programmers who use Microsoft products for development. The example sent is only to be as complete as possible in the indications of the problem. But the problem is specific to using services by importing AIDL files. Also using the only example found on the web, ADILDemo, this too has the same problem of not starting the PROXY. So I assume the problem is generic. Now I'm wondering is there a microsoft service on android that uses AIDL file to handle this to use as an example? If yes which one is it? Can you send me a link? This allows us to check whether the problem exists or not.
    I remember that we programmers like you in support get up in the morning to work. If we have chosen to use Microsoft products, we contribute in our small way to keeping the Microsoft world active.

    Sure of your professionalism, I look forward to your feedback.

    Sincerely.

    0 comments No comments