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
13
votes
4 answers

When to use an aidl based service?

Under what circumstances would using AIDL to define a service interface be the correct decision (rather than just creating an extension to the service class)?
MalcomTucker
  • 7,407
  • 14
  • 72
  • 93
13
votes
3 answers

How to find the status of VPN connection through framework APIs or any other efficient method?

So far: I found the following solutions Using Broadcastreceiver The broadcast receiver is deprecated from ICS Using Ping or Traceroute It's definitely going to take lots of time and its not efficient Polling for DNS server changes It's definitely…
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
13
votes
3 answers

Android - Using method from a Service in an Activity?

I have the folowing method in a Service in my appplication: public void switchSpeaker(boolean speakerFlag){ if(speakerFlag){ audio_service.setSpeakerphoneOn(false); } else{ …
Donal Rafferty
  • 19,707
  • 39
  • 114
  • 191
13
votes
1 answer

Android remote service callbacks

(I have a remote service with an AIDL interface that is used by several client apps. I would like to add an asynchronous method to the interface for calls that take some time, but I need the solution to be secure, meaning that only my applications…
Android QS
  • 416
  • 2
  • 8
  • 17
12
votes
4 answers

Error while compiling AIDL

I'm trying to compile .aidl and generate .java but: Error:Execution failed for task ':library:compileReleaseAidl'. > java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing…
Michele Lacorte
  • 5,323
  • 7
  • 32
  • 54
12
votes
3 answers

How do I use AIDL tool from command line using SDK sample code?

My question concerns using aidl.exe (on a Windows system) from the command line. This question has nothing to do with Eclipse, Netbeans, etc. Included with the Android SDK are the following three AIDL definition files: IRemoteService.aidl …
Matt
  • 143
  • 1
  • 1
  • 6
11
votes
1 answer

Parcelize annotation in AIDL: Incompatible types: Object cannot be converted to MyCustomObject

I'm rewriting my model class to Kotlin, which has to be Parcelable and used in AIDL: @Parcelize data class MyCustomObject(val value1: String, val value2: String) : Parcelable During compilation it crashes with error: error: incompatible types:…
Yurets
  • 3,999
  • 17
  • 54
  • 74
11
votes
2 answers

aidl oneway keyword error

I am implementing an aidl interface, and for some reason, the following code gives me an error: // IApkinsonCallback.aidl package com.applications.philipp.apkinson.interfaces; /** Interface implemented by Apkinson so plugins can give feedback…
PKlumpp
  • 4,913
  • 8
  • 36
  • 64
11
votes
4 answers

android N failing to compile in app billing AIDL

I was just trying to compile my app with the new preview SDK 24 Android N in Android Studio 2.1 Preview 1. I have in app billing in my app. When trying to build the app I get the following exception aidl.exe E 6416 3312 io_delegate.cpp:102] Error…
10
votes
4 answers

How to make an inner class Parcelable

I need to know how to make an inner class Parcelable so that objects of its type can be passed via AIDL to a remote service. I cannot find any information on this. Here is example code of what I am trying to accomplish, but it doesn't compile…
MichaelL
  • 101
  • 1
  • 3
10
votes
4 answers

Need AIDL tutorials

I am working on AIDL and consider the APIDemo for it. But if some one has more knowledge please share it.
Cool Java guy מוחמד
  • 1,687
  • 4
  • 24
  • 40
9
votes
5 answers

AIDL vs Messenger

Requirement: Need to expose a service/contract from a different process to other apps. For example: getPhoneRecord(recordId), deletePhoneRecord(phoneId) etc. Potential solutions: Messenger or AIDL Based on my analysis, I think AIDL is the only…
user3277846
  • 1,019
  • 1
  • 10
  • 15
9
votes
3 answers

android-studio can't find an aidl interface for use in class

I have an interface defined in the aidl but I can't extend it or find it any way. The ide just tells me: Can not resolve symbol 'KeyEventListener' Any idea how to fix this? Additional infos: KeyEventListener is the name of the interface defined in…
aichingm
  • 738
  • 2
  • 7
  • 15
9
votes
2 answers

Can an Android service provide two interfaces to communicate with?

I have a service that communicates through AIDL with other services. I want that service to be bound by activities in my application. Can the service define two binders\interfaces? I've tried yo use a messenger for communicating with the activities,…
lironda
  • 171
  • 3
  • 5
9
votes
1 answer

Unable to overload method in AIDL interface

I am unable to overload a method in the AIDL interface. I wanted to have 2 functions with the same name but diffrent number of arguments like this: boolean callMethod(in String pClass, in String pMethod, in String pParam); void callMethod(in…
Rajan
  • 292
  • 2
  • 10
1
2
3
39 40