Getting Started
Welcome to rsbinder! This guide will help you get started with Binder IPC development using Rust.
Learning Path
If you are new to Binder IPC, we recommend following this learning path:
-
Overview and Architecture - Start here to understand Binder IPC fundamentals
- Learn about the core concepts and components
- Understand the relationship between services and clients
- See how AIDL generates Rust code
-
Installation - Set up your development environment
- Install required dependencies
- Set up binder devices and service manager
- Configure your Rust project
-
Hello World - Build your first Binder service
- Create a simple echo service
- Learn AIDL basics
- Understand service registration and client communication
-
AIDL Guide - Dive deeper into AIDL language features:
- Data Types - How AIDL types map to Rust types
- Parcelable - Custom data structures for IPC
- Enum and Union - Enum and union type support
- Annotations - Code generation annotations
-
Service Development - Build production-quality services:
- Service Patterns - Advanced service patterns and best practices
- Async Service - Non-blocking services with tokio
- Callbacks and Interfaces - Bidirectional communication
- ParcelFileDescriptor - File descriptor passing
- Error Handling - Error types and handling strategies
- Service Manager (HUB) - Service registration and discovery
-
RPC Transport - Binder-over-socket:
- The opt-in second stack that runs on Linux, Android, and macOS
- Unix-domain sockets, vsock, or TLS instead of
/dev/binder - Same generated AIDL stubs as the kernel-binder path
-
Platform-specific Setup - Choose your target platform:
- Linux Setup - For Linux development
- Android Development - For Android integration
Platform Requirements
rsbinder ships two parallel stacks — pick by platform and use case:
- Kernel binder (the default in this guide): Linux 5.0+ with
binderfs enabled (the
binderfsfilesystem landed in 5.0), or Android. Talks to the kernel binder driver through/dev/binderfs/binder(Linux) or/dev/binder(Android). - RPC transport (binder-over-socket, opt-in via the
rpcfeature): pure user-space, no kernel binder driver. Runs on Linux, Android, and macOS over Unix-domain sockets, vsock, or TLS. See the RPC Transport chapter.
Windows: not supported on either stack.
macOS: kernel binder is not supported (no kernel driver), but the RPC transport works natively — useful for developing and testing RPC services on a macOS workstation without a Linux VM.
Quick Start Checklist
Before diving into development, ensure you have:
- Rust 1.85+ installed
- Linux kernel with binder support enabled (or an Android device/emulator)
-
Created binder device using
rsb_device(Linux only) -
Service manager (
rsb_hub) running (Linux only) - Basic understanding of AIDL syntax (covered in the Hello World tutorial)
Key Concepts to Understand
- Services: Server-side implementations that provide functionality
- Clients: Applications that consume services through proxies
- AIDL: Interface definition language for describing service contracts
- Service Manager: Central registry for service discovery
- Parcels: Serialization format for data exchange
- Binder Objects: References that enable cross-process communication
Common Development Workflow
- Define your service interface in an
.aidlfile - Use
rsbinder-aidlto generate Rust code - Implement your service logic
- Register the service with the service manager
- Create clients that discover and use your service
Ready to start? Head to the Overview section to learn the fundamentals!