Questions tagged [aidl]

Android Interface Definition Language is a special language that allows a server and a client to establish interface for Inter Process Communication (IPC).

AIDL - is a special language that allows a client and a server process to establish interface that can be used for Inter Process Communication. This interface is defined in the .aidl files. The syntax of the Android interface is similar to the syntax of Java interfaces but has several peculiarities. Aidl files are compiled into the Java files by a special aidl tool.

By default, for security reasons all applications in Android run with their own uid and in different processes. At the same time, so as Android is a mobile operating system it should provide abilities to maximize the reuse of components of the applications. Thus, the mechanisms for exchanging information have to be implemented. These mechanisms are called Inter Process Communication. For Android there was implemented a special IPC mechanism called Binder.

To communicate with each other Android process have to decompose the information into primitives that can be understood by Binder driver. This driver have to send these primitives to remote process and compose them there into the sent information. The process of decomposing and composing is difficult to write. Thus, OHA has proposed a special tool called aidl to facilitate this process.

Links:

  1. Android developers: aidl
  2. Remote methods and aidl
588 questions
5
votes
1 answer

Android binder generator fails

I have defined an AIDL file with my interface. Something like this: interface IResPlugin { int discoverType(); Map onClick( in int id, in Map state ); int getLayoutId(in int option); int getMeasures(); String…
hilbert
  • 171
  • 1
  • 5
5
votes
2 answers

Google Play Billing : how to simulate 'Account Hold' status (in debug/sandbox mode)

Before November 2020, an Android app on Google Play has to manage 'Account Hold' status. https://developer.android.com/distribute/play-policies Question is: how to simulate 'Account Hold' status so that I can check that my app manages properly this…
toto_tata
  • 14,526
  • 27
  • 108
  • 198
5
votes
1 answer

How to call an Android remote service (IPC) from a Widget / local service?

I'm trying to remote control a live wallpaper from a widget. They're in the same APK, but obviously different processes. Calling an "activity" of the live wallpaper is of little use to me since it is a different process. The widget has simple…
Toumal
  • 562
  • 4
  • 10
5
votes
3 answers

The import android.os.ServiceManager cannot be resolved

I'm using aidl to answer call automagically, code as following: ITelephony.Stub.asInterface(ServiceManager.getService("phone")) .answerRingingCall(); I import ServiceManager.class import android.os.ServiceManager; but there's a problem:The…
Sean
  • 6,785
  • 7
  • 23
  • 26
5
votes
3 answers

What is the difference between broadcast receiver, AIDL, and Messenger?

Can someone please distinguish between the scenarios where one should use a broadcast receiver, an AIDL (Android Interface Definition Language), and a messenger? I was told that using a broadcast receiver is battery draining so I should not make use…
JavaN00b
  • 69
  • 1
  • 8
5
votes
2 answers

Why is AIDL/Messenger bound to a Service?

Scenario: I have a Controller (normal Java class) that must be able to pilot several Slaves. A Slave's nature can differ, so that it can either be: A Service, let's call it a ServiceSlave: the lifecycle of this object usually differs from the…
Sebastiano
  • 12,289
  • 6
  • 47
  • 80
5
votes
3 answers

What are the ordering guarantees of AIDL "oneway" remote calls?

AIDL methods and interfaces marked with the "oneway" keyword are asynchronous Binder calls for remote processes, and it is said that the ordering of the calls is not guaranteed. On the other hand, the last comment of Dianne Hackborn (author of…
br1
  • 425
  • 4
  • 9
5
votes
1 answer

Remote service, leaks activity when rotating

I've got a problem with a callbacks in remote service, after register a callback rotation cause an activity leak. Can You give me some suggestion what I'm doing wrong. IRemoteApi.aidl import com.example.remoteservice.IRemoteListener; interface…
Merhold
  • 106
  • 1
  • 5
5
votes
3 answers

Pass active objects between services through AIDL

I'm trying to have a common object shared for several services in different packages. Each service must call the same object. For example, Service A (from APK A) instantiates a custom object and I want that Service B and C (from APK B and C)…
nbe_42
  • 1,212
  • 1
  • 14
  • 22
5
votes
1 answer

AIDL unable to find the definition of a Parcelable class

I have the following project structure. My StockInfo.java is perfectly fine. StockInfo.java (No error) package org.yccheok.jstock.engine; import android.os.Parcel; import android.os.Parcelable; public class StockInfo implements Parcelable { …
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
5
votes
2 answers

How can I use AIDL remote service to deal with defferent clients' concurrent requests?

I'm writting a plug-in which defines a remote Service and provides a AIDL interface for 3rd party developers. How can I use this remote service to deal with defferent clients' concurrent requests? It is that service apk's activitys can keep status…
Shrek.Z
  • 51
  • 1
  • 2
5
votes
2 answers

Android: transfer byte array with AIDL

I need to transfer byte array between an Android service and client. I have tried to define an aidl interface like: interface IMyService { int putBytes(String key, in List bytes); int getBytes(String key, out List bytes); …
Dagang
  • 24,586
  • 26
  • 88
  • 133
5
votes
5 answers

Android : Do Application Login in background on boot-up

I have a VOIP Application, I need to login the application in background on device bootup. Currently the init to my application is done on UI Active(onCreate()). I have the following things in my mind, can anyone help and clear my doubts. The …
NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
4
votes
3 answers

Android: AIDL parameter receiving null

I got an activity and a service that are binded. When the onServiceConnected is called in the ServiceConnection, I do the next thing: mInterfaceObject = IInterface1.Stub.asInterface(arg1); mInterfaceObject.register(mController); Where mController…
Ion Aalbers
  • 7,830
  • 3
  • 37
  • 50
4
votes
1 answer

Can't use .aidl files across library projects?

In the spirit of re-using code, I'm trying to create a few library projects. However, I seem to run into a problem defining .aidl files that span the libraries. Here is the problem: In library A I have Foo.java and Foo.aidl. Foo.java is…
jsmith
  • 4,847
  • 2
  • 32
  • 39