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 ?
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.
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.
1)string 2)list 3)map 4)All native java datatype - Android 2.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With