Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to compile aidl file in android project?

Tags:

android

aidl

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 ?

like image 431
user1479604 Avatar asked Sep 21 '12 06:09

user1479604


People also ask

How does AIDL work on Android?

AIDL uses a simple syntax that lets you declare an interface with one or more methods that can take parameters and return values. The parameters and return values can be of any type, even other AIDL-generated interfaces. You must construct the . aidl file using the Java programming language.

How do you make AIDL?

Under Gradle you have to place the AIDL file in src/main/aidl/ for it to be automatically detected. During the build the Java interface and stub implementation is then put into build/generated/source/aidl/{debug,release}/, otherwise the information provided by Chirag Raval is still correct.

What data types are supported by AIDL in Android?

1)string 2)list 3)map 4)All native java datatype - Android 2.


2 Answers

AIDL (Android Interface Definition Language) is similar to other IDLs you might have worked with. It allows you to define the programming interface that both the client and service agree upon in order to communicate with each other using interprocess communication (IPC)

Where to place aidl file ?

Save aidl file in the source code (in the src/ directory) of both the application hosting the service and any other application that binds to the service.

Will aidl file gets compiled, If i build apk ?

When you compile your project, then there project automatically generate one file in gen foler.

Look at here for more details.

like image 162
Chirag Avatar answered Oct 13 '22 22:10

Chirag


In addition to the previous answers, you can also build just the AIDL files.

Android Studio 3.0.1 (It should be the same in Android Studio 2.x.x):

View -> Tool Windows -> Gradle

Right-click on compileDebugAidl -> Run

Compiling AIDL only. Right-click and execute

like image 30
TylerBUrquhart Avatar answered Oct 14 '22 00:10

TylerBUrquhart