Lines Matching refs:interface

12       <li><a href="#Implement">Implement the interface</a></li>
13 <li><a href="#Expose">Expose the interface to clients</a></li>
30 worked with. It allows you to define the programming interface that both
40 different applications, you should create your interface by <a
43 implement your interface <a
49 <p>Before you begin designing your AIDL interface, be aware that calls to an AIDL interface are
56 this is your main UI thread, that thread continues to execute in the AIDL interface. If it is
60 interface by <a href="{@docRoot}guide/components/bound-services.html#Binder">implementing a
65 happening at the same time. In other words, an implementation of an AIDL interface must be
70 The implementation of the interface eventually receives this as a regular call from the {@link
78 <p>You must define your AIDL interface in an {@code .aidl} file using the Java
83 generate an {@link android.os.IBinder} interface based on the {@code .aidl} file and save it in
85 interface as appropriate. The client applications can then bind to the service and call methods from
91 <p>This file defines the programming interface with method signatures.</p>
93 <li><a href="#ImplementTheInterface">Implement the interface</a>
94 <p>The Android SDK tools generate an interface in the Java programming language, based on your
95 {@code .aidl} file. This interface has an inner abstract class named {@code Stub} that extends
96 {@link android.os.Binder} and implements methods from your AIDL interface. You must extend the
99 <li><a href="#ExposeTheInterface">Expose the interface to clients</a>
106 <p class="caution"><strong>Caution:</strong> Any changes that you make to your AIDL interface after
109 in order for them to access your service's interface, you must maintain support for the original
110 interface.</p>
115 <p>AIDL uses a simple syntax that lets you declare an interface with one or more methods that can
120 file must define a single interface and requires only the interface declaration and method
137 java.util.List} interface.</p>
145 use the {@link java.util.Map} interface.</p>
150 they are defined in the same package as your interface.</p>
152 <p>When defining your service interface, be aware that:</p>
161 android.os.IBinder} interface (except for comments before the import and package
174 /** Example service interface */
175 interface IRemoteService {
188 build your application, the SDK tools generate the {@link android.os.IBinder} interface file in your
200 <h3 id="Implement">2. Implement the interface</h3>
202 <p>When you build your application, the Android SDK tools generate a {@code .java} interface file
203 named after your {@code .aidl} file. The generated interface includes a subclass named {@code Stub}
204 that is an abstract implementation of its parent interface (for example, {@code
211 returns an instance of the stub interface. See the section <a href="#Calling">Calling an IPC
214 <p>To implement the interface generated from the {@code .aidl}, extend the generated {@link
215 android.os.Binder} interface (for example, {@code YourInterface.Stub}) and implement the methods
218 <p>Here is an example implementation of an interface called {@code IRemoteService} (defined by the
234 which defines the RPC interface for the service. In the next step, this instance is exposed to
237 <p>There are a few rules you should be aware of when implementing your AIDL interface: </p>
249 <h3 id="Expose">3. Expose the interface to clients</h3>
251 <p>Once you've implemented the interface for your service, you need to expose it to
252 clients so they can bind to it. To expose the interface
256 service that exposes the {@code IRemoteService} example interface to clients. </p>
267 // Return the interface
289 <p>The client must also have access to the interface class, so if the client and service are in
292 interface&mdash;providing the client access to the AIDL methods).</p>
304 // Following the example above for an AIDL interface,
332 an IPC interface, you can do that. However, you must ensure that the code for your class is
334 android.os.Parcelable} interface. Supporting the {@link android.os.Parcelable} interface is
341 <li>Make your class implement the {@link android.os.Parcelable} interface.</li>
345 the {@link android.os.Parcelable.Creator Parcelable.Creator} interface.</li>
428 <p>Here are the steps a calling class must take to call a remote interface defined with AIDL: </p>
431 <li>Declare an instance of the {@link android.os.IBinder} interface (generated based on the
443 <li>Call the methods that you defined on your interface. You should always trap
449 Context.unbindService()} with the instance of your interface. </li>