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
0
votes
2 answers

Android Studio/Gradle fails to build due "missing" Parcelable class in java file

I have a service with several AIDL files. To one, I just added a custom object that I defined in a .java file as part of the interface as an "in" parameter, and included the .aidl for it with the parcelable declaration. The build fails with an…
JCampy
  • 181
  • 1
  • 5
0
votes
1 answer

How do I bind my service to two clients?

I have a background service running and I would like to use AIDL to be able to communicate with 3rd party apps . I experimented with an app communication using AIDL and it's working great . my question is what if I want to communicate with another…
0
votes
1 answer

OnServiceConnected never called when binding to background service with AIDL

I have a background service that is started on BOOT COMPLETE with a broadcast receiver. what I wanted to do is to create another application that will bind to that service using AIDL interface. the app simply asks the user to enter ip number and…
0
votes
1 answer

How to pass Remote Interface (aidl) throughout Activities?

I am developing an application using services and Remote interface. I have a question about passing the reference of my Remote interface throughout Activities. In my first Activity, I bind my service with my activity, in order to get a reference to…
Spredzy
  • 4,982
  • 13
  • 53
  • 69
0
votes
0 answers

inout String acceptable in AIDL

The documentation states that all non-primitive parameters require a directional tag indicating which way the data goes; and primitives are in by default, and cannot be otherwise. Then they proceed with giving an example where a String is missing…
Daniel
  • 2,380
  • 29
  • 44
0
votes
0 answers

this.stopSelf() does not stop the service sometimes

I have following piece of code in onCreate() of a AIDL service @Override public void onCreate() { log("onCreate()"); if (SystemProperties.getInt(DONT_START,0)==1) { // Do not start the service if some system property is set log("not…
RocketRandom
  • 1,102
  • 7
  • 20
0
votes
1 answer

Block incoming call before partial ringing

I'm creating a call blocking app. Had no idea about it so googled it and followed this link answer . Its working as a blocker but have a problem. Incoming call always received by default phone app so happens a little ringing and then ends the call.…
demo_Ashif
  • 139
  • 2
  • 18
0
votes
2 answers

Pass data between two Activities in different procceses

I need to pass Objects between two different processes, I read all the materials about it but I still have some questions 1.I can pass objects between different processes through AIDL, but its complicated and messy, I also read about he Messenger to…
AlexKulr
  • 69
  • 11
0
votes
1 answer

Can't import java.text.SimpleDateFormat in AIDL

/** * Set the mode of the device. * * @param clock set the clock * @param devTime device alarm time including hour,minute,second. * @return true if the operation is successful or false if erroneous. */ boolean reqRemoveAlarm(int clock,…
user3732316
  • 63
  • 1
  • 7
0
votes
2 answers

How can Android AIDL service differentiate the two applications using it?

I'm building an Android service into a lib, when it is called to start, it runs in its own process. Other APPs could communicate with this service through AIDL interface. The situation is: this service gets data from a particular web, and later on,…
0
votes
3 answers

Can't bind to Service

I have an aidl file defined as follows: package com.erbedo.callalert; interface RemoteCallAlert { void notifyCallEnded(); } The service is: package com.erbedo.callalert; public class CallAlert extends Service { Filter callListener; …
lbedogni
  • 7,917
  • 8
  • 30
  • 51
0
votes
1 answer

binding Service using AIDL vs binding using action?

According documentaion on Developer's forum, this is how I can bind my service using AIDL: /* Establish a couple connections with the service, binding by interface names.This allows other applications to be installed that replace the remote…
Nayanesh Gupte
  • 2,735
  • 25
  • 37
0
votes
1 answer

Android AIDL and Service and Activity parceable seems to be passing default class values

I have a strange issue going on, I have created an Android service, and a widget that consumes it. I have some complex objects that are sent between the two via AIDL. I have no problems registering my callbacks, and the service is populating the…
bhawkins
  • 326
  • 2
  • 11
0
votes
1 answer

Service callback throws: Uncaught remote exception! (Exceptions are not yet supported across processes.)

I'm having some issues with my callbacks. Here is my code: Activity: private ICallback callback = new ICallback.Stub() { @Override public void fire() throws RemoteException { mTextView.setText("fired"); } }; //then in onCreate i…
iGio90
  • 3,251
  • 7
  • 30
  • 43
0
votes
2 answers

Complex Object in aidl file having nested parceable

I have developed one demo for IPC and use bounded servie to handle it....but facing some issue while using complex data structue( i.e. parceable inside parceable). I am having the data structure like this... ObjectX.java public class ObjectX…
SweetWisher ツ
  • 7,296
  • 2
  • 30
  • 74