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
8
votes
1 answer

Is it possible to use inheritance in AIDL interfaces?

I want to share an interface via AIDL with client applications. I have been getting compile time errors. The code snippet is :- interface ChildListener extends ParentListener { public void onUpdate(Class1 c1); } AIDL Set(All in the same…
Robin
  • 497
  • 5
  • 19
8
votes
3 answers

Passing enums through aidl interfaces

As enums aren't primitive types, what's the most effective way to pass an enum through an aidl interface in Android? Is there a way to convert the enum to an ordinal first?
Phillip
  • 81
  • 1
  • 1
  • 2
8
votes
1 answer

AIDL not finding inner classes

Trying to compile AIDL files found in the Android repo along with my Android project to use some of the built-in interfaces. However, whenever I get to an inner type, I get the following error: ITuner.aidl aidl E 01-12 17:32:41 59280 1006000…
Jason
  • 13,563
  • 15
  • 74
  • 125
8
votes
3 answers

Use AIDL interfaces across module/subprojects in Gradle

I have a project consisting of multiple gradle modules (plugin com.android.library) referencing each other (tree, not flat). I use AIDL intensively and thus it happens that I reference AIDL interfaces from one module (modA) in an AIDL interface in…
Marvin W
  • 434
  • 4
  • 16
8
votes
2 answers

AIDL service not connecting after bindService()

I am trying to develop a setup of 2 applications (service app + client app) using AIDL. I have currently a setup of 3 modules: android-agent-framework (android library module holding only the AIDL file) android-agent (the…
TyrManuZ
  • 2,039
  • 1
  • 14
  • 23
8
votes
1 answer

Managing remote service callbacks

I have a situation where I feel like I'm about to reinvent the wheel or go around the houses, to handle something that there is already a 'design' for - so before I do, I was hoping I could get a second opinion please. I have a remote service. It is…
brandall
  • 6,094
  • 4
  • 49
  • 103
8
votes
3 answers

maven build android project: specify the location of aidl file

My android project has only aidl file, project structure is like below: MyProject/ src/ main/ com.my.aidl/ IMyService.aidl pom.xml I am building my android project with maven. My pom uses the dexguard-maven-plugin…
user842225
  • 5,445
  • 15
  • 69
  • 119
8
votes
2 answers

Does oneway declaration in Android .aidl guarantee that method will be called in a separate thread?

I am designing a framework for a client/server application for Android phones. I am fairly new to both Java and Android (but not new to programming in general, or threaded programming in particular). Sometimes my server and client will be in the…
Dan Menes
  • 6,667
  • 1
  • 33
  • 35
8
votes
3 answers

Android In App Billing SecurityException "Binder invocation to an incorrect interface"

I am trying to get the google In App Billing services to work. I've got so far that the service is bound and connected, but once I try to fetch some data from the service it crashes with the log: 04-02 10:36:32.795 10569-10651/my.app.package…
McFarlane
  • 1,777
  • 2
  • 22
  • 39
8
votes
0 answers

how to write a proguard config for a remote service lib

i will support a sdk to other users.the export jar file is works good for other app. but in fact,i need to proguard this sdk file.i had write a proguard config file. -optimizationpasses…
alex
  • 81
  • 4
8
votes
6 answers

AIDL file does not generated a Java file

I have defined an AIDL android interface to make available a service from other applications. My problem is that in my project, Android does not generate the Java file from this AIDL. Note that the project compiles and works fine. However, if I…
pablo.mj
  • 121
  • 1
  • 1
  • 6
8
votes
4 answers

Android AIDL security

Is there any security provided when an application calls a remote service using AIDL? Or is it simply like a malicious application could read the data?
user567879
  • 5,139
  • 20
  • 71
  • 105
8
votes
3 answers

Android broadcast receivers vs aidl

What are the pros and cons of using aidl vs broadcast receivers for sending messages between apps (for both background and foreground handling)? I've been using receivers which is nice due to the subscription model with intent filters, and the ease…
Ben
  • 16,124
  • 22
  • 77
  • 122
7
votes
2 answers

How to define parcelable of interface type in .aidl file?

I have an .aidl file that defines a single parcelable of an interface type, let's say parcelable MyInterface; Whereby MyInterface is a java interface declared in MyInterface.java that extends the Parcelable interface. The android parcelable…
Landschaft
  • 1,217
  • 1
  • 12
  • 12
7
votes
4 answers

Android: AIDL refusing to generate code from aidl file defining parcelable

I am trying to build a library with aidls. LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := test LOCAL_SRC_FILES := $(call all-java-files-under, java) \ java/com/testapp/Istudent.aidl \ java/com/testapp/Itest.aidl…
Aada
  • 1,591
  • 7
  • 30
  • 57
1 2
3
39 40