Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>AIDL and Messenger are used for IPC with other applications/processes. From the <a href="http://developer.android.com/guide/components/aidl.html" rel="nofollow noreferrer">Android API Guide</a>:</p> <blockquote> <p><strong>Note</strong>: Using AIDL is necessary only if you allow clients from different applications to access your service for IPC and want to handle multithreading in your service. If you do not need to perform concurrent IPC across different applications, you should create your interface by implementing a Binder or, if you want to perform IPC, but do not need to handle multithreading, implement your interface using a Messenger. Regardless, be sure that you understand Bound Services before implementing an AIDL.</p> </blockquote> <p>If your activities are in the same process as the service, you just need to extend Binder.</p> <blockquote> <p><strong>Extending the Binder class</strong></p> <p>If your service is private to your own application and runs in the same process as the client (which is common), you should create your interface by extending the Binder class and returning an instance of it from onBind(). The client receives the Binder and can use it to directly access public methods available in either the Binder implementation or even the Service. This is the preferred technique when your service is merely a background worker for your own application. The only reason you would not create your interface this way is because your service is used by other applications or across separate processes.</p> </blockquote> <p>This graphic regarding the bound service lifecycle may help with how you are binding/unbinding (<a href="http://developer.android.com/guide/components/bound-services.html#Lifecycle" rel="nofollow noreferrer">http://developer.android.com/guide/components/bound-services.html#Lifecycle</a>):</p> <p><img src="https://i.stack.imgur.com/2DFoy.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload