Skip to content

dev-bilal-azzam/IPCClient

Repository files navigation

client

AIDL Color Client

This project demonstrates how to connect to a remote AIDL service from another Android application.

The client app binds to the server app service and requests a random color.

The returned color is then applied to the Compose UI background.

What This Project Demonstrates

  • Connecting to remote services
  • Using AIDL interfaces
  • Cross-app Binder communication
  • Updating Compose UI using remote data

Flow

  1. Client binds to the remote service.
  2. Service connection returns the Binder object.
  3. Client calls getColor().
  4. Server returns a random color.
  5. UI background updates with the received color.

Important Notes

  • Android 11+ requires package visibility.
  • The client app must declare the server package inside:
<queries>
    <package android:name="com.devbilal.ipc" />
</queries>
  • Always check the result of bindService() during debugging.
  • onServiceConnected() will not be called if binding fails.
  • The service action name must exactly match the server manifest action.
  • The server package name inside setPackage() must match the installed app package.
  • Both apps must contain the exact same AIDL contract.
  • Compose UI updates require mutableStateOf() for recomposition.
  • Remote calls can throw RemoteException, so they should be wrapped in try/catch.

About

This application demonstrates how to consume a remote AIDL service from another Android application. It binds to the IPC Server App service, requests a random color through IPC, and updates the UI based on the received value. The app acts as the service consumer (client) in a cross-process communication setup.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors