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

Android ipc LocalSocket vs Binder (AIDL)

I want every app to be able to send data to my service. Therefore I need inter process communication. Every page I can find proposes to use Messenger, AIDL or Intents (BroadcastReceiver). So far what I could figure out by building some test apps is…
Ant1Zykl0n
  • 372
  • 4
  • 11
7
votes
1 answer

GREF increasing / decreasing in multi-threaded service (aidl) - what does it mean?

I have an android activity and a service implemented using aidl. Works like a champ, I have a callback setup to pass some thread notifications back to the UI, and that appears to work fine, with the exception of lots of GREF has increased to 101,…
Chrispix
  • 17,941
  • 20
  • 62
  • 70
7
votes
1 answer

Android sharing SurfaceTexture between two processes

is it possible to share a SurfaceTexture between two processes, for example an Activity and a Service? I would like to create an Activity with a TextureView, and update its SurfaceTexture from a separate Service. So far I'm creating a SurfaceTexture…
7
votes
1 answer

Android : Create a single task with multiple applications' activities (Lauchmode issue)

I don't know how to tackle this Android issue. In few words, the flow between my 2 applications is as below : Flow Bind Application A to a service in Market application (AIDL) Register a BroadcastReceiver and call a service method that returns a…
johann
  • 1,115
  • 8
  • 34
  • 60
6
votes
1 answer

Why can't a .aidl be placed into a library project?

I came across a comment this answer which states that a library project: cannot hold .aidl files, cannot depend on another library project, cannot hold assets Well, that comment was made about a year and a half ago, and I can tell you with…
Bill The Ape
  • 3,261
  • 25
  • 44
6
votes
1 answer

Android AIDL support "short" type?

Does AIDL support short type ? http://developer.android.com/guide/developing/tools/aidl.html It said "All primitive types in the Java programming language (such as int, long, char, boolean, and so on)" But it seems cannot use short in AIDL. thanks !
aquatear
  • 89
  • 1
  • 7
6
votes
3 answers

When should I use unbindService(), and how should I use it properly to unbind from a remote service that is using an AIDL interface?

I'm writing a simple music player, and I've created a playback service which implements an AIDL interface to bind with the clients, one a simple track browser and the other an even simpler player activity. The service controls the MediaPlayer object…
Junseok Lee
  • 705
  • 5
  • 18
6
votes
4 answers

Android Aidl error sdk build tools 29.0.0

I upgraded my Android app to start using SDK 29 and build tools 29.0.0. When compiling in Android Studio I get an error: Process 'command 'C:\Users\ma_fo\AppData\Local\Android\Sdk\build-tools\29.0.0\aidl.exe'' finished with non-zero exit value…
Marcel
  • 81
  • 1
  • 5
6
votes
2 answers

Can Messenger (lightweight alternative to AIDL) be used for cross-application communication?

A quick question: the Android docs say very clearly that Messenger is an alternative for AIDL for IPC (inter process communication). They never explicitly say though if this extends to processes running in different applications, or just within one…
Jan Żankowski
  • 8,690
  • 7
  • 38
  • 52
6
votes
3 answers

Android Remote methods (AIDL) vs Intents - performance & battery usage

My team is working on an Android project which consists of several Android applications which exchange data (on the same phone). The idea is to have several applications which are collecting some data and send this data to the main application. The…
eold
  • 5,972
  • 11
  • 56
  • 75
6
votes
2 answers

Android AIDL with Java generics

Does Android AIDL support generics? For example, assume that I have a class Result, where T can be any type including primitives (via autoboxing) or other custom classes such as Car. Any custom classes implement Parcelable as required by…
Daniel
  • 2,380
  • 29
  • 44
6
votes
3 answers

readFromParcel() method in Parcelable interface

I have a simple doubt in marshaling during service creation. When there is a writeToParcel() method declared in Parcelable interface which is invoked in stub generated (if aidl method parameters are declared as in), why there is no readFromParcel()…
Babu Prasad
  • 344
  • 4
  • 12
6
votes
1 answer

Best way for Service that starts Activity to communicate with it

I have a service that listens to a socket. When receiving certain input it is to create an activity. When receiving other input, it is to kill this activity. I have struggled for a while to make the service communicate with the activity through AIDL…
pgsandstrom
  • 14,361
  • 13
  • 70
  • 104
6
votes
3 answers

how to compile aidl file in android project?

Hi can anyone tell me where to place aidl file in project tree and how to use it in project source. Will aidl file gets compiled, If i build apk ?? How to use it in eclipse ?
user1479604
  • 117
  • 1
  • 3
  • 12
6
votes
1 answer

android aidl import

I'm trying to import android.content.Context to AIDL file but eclipse doesn't recognize it.. here's my code: package nsip.net; import android.content.Context; // error couldn't find import for class ... interface IMyContactsService{ void…
doronsl
  • 259
  • 1
  • 3
  • 5