Questions tagged [android-binder]

Android's lightweight remote procedure call mechanism designed for high performance when performing in-process and cross-process calls.

While the term "binder" is somewhat generic, its most popular namesake is the Android-specific interprocess communication mechanism and remote method invocation system. It forms the basis for many of Android's core services.

The official documentation is here, and there is a collection of in-depth information at this wiki.

244 questions
10
votes
5 answers

How can a remote Service send messages to a bound Activity?

I've read the documentation about Bound Services, where it is shown that you can easily communicate through Messages from an Activity to a remote (i.e. not in the same context) Service but is there any way to send messages from the Service to the…
Gianni Costanzi
  • 6,054
  • 11
  • 48
  • 74
9
votes
2 answers

Can an Android service provide two interfaces to communicate with?

I have a service that communicates through AIDL with other services. I want that service to be bound by activities in my application. Can the service define two binders\interfaces? I've tried yo use a messenger for communicating with the activities,…
lironda
  • 171
  • 3
  • 5
7
votes
2 answers

Binder preventing garbage collection

I think I tracked down a memory leak and want to confirm what I think may true about how Android's Binder is implemented. In this case I have a Service and an Activity, each in their own process. I created an AIDL that allows me to pass a Callback…
satur9nine
  • 13,927
  • 5
  • 80
  • 123
7
votes
1 answer

Android throw DeadObjectException: Transaction failed on small parcel; remote process probably died just in HUAWEI Android 8.0.0

1804-11 09:43:24.482 22968 22968 E CrashHandler: In thread: Thread[main,5,main] 1904-11 09:43:24.482 22968 22968 E CrashHandler: UncaughtException detected: java.lang.IllegalStateException: Failure reading AssistStructure data:…
7
votes
2 answers

Android ipc LocalSocket vs Binder (AIDL)

I want every app to be able to send data to my service. Therefore I need inter process communication. Every page I can find proposes to use Messenger, AIDL or Intents (BroadcastReceiver). So far what I could figure out by building some test apps is…
Ant1Zykl0n
  • 372
  • 4
  • 11
7
votes
1 answer

Rapid IPC with Messengers or AIDL

I'm attempting to create a program in Android which communicates rapidly with a remote service (~40,000/sec), however all Android IPC seems to fall short of being able to accomplish this task. My first attempt involved a standard Messenger system…
Beryllium
  • 556
  • 1
  • 7
  • 20
7
votes
0 answers

Determine the origin of an Intent in a BroadcastReceiver

I am looking for a way to determine what application sent an Intent. At present, I've registered a BroadcastReceiver and have been trying to work with Binder.getCallingPid, but it usually returns my app's PID. What I find weird is the usually part,…
Tom
  • 6,947
  • 7
  • 46
  • 76
7
votes
1 answer

In AOSP, where is the ServiceManager implemented

In the IServiceManager.cpp file, I see the BnServiceManager::onTransact function definition. Inside that function, there is a call to "addService", "listServices" etc. I couldn't find the implementation for those functions (which are declared under…
Chakkra
  • 337
  • 3
  • 10
7
votes
2 answers

How to check if two Android binder proxy objects are equal?

I have a question regarding Android's binder. If I understood correctly, a Binder can be passed between processes. On the service side, there is a Binder object (the original object). On the client side (in separate process), there is a BinderProxy…
Kartik Sankaran
  • 290
  • 3
  • 11
6
votes
1 answer

How to setup a Jupyter-notebook with calysto-processing to run in Binder?

I have jupyter-notebook running on my own Mac with the caylsto-processing library plugged in so I can run processing scripts in a notebook in a browser tab. But I am trying to be able to run this all in binder, so that I can share my processing…
6
votes
3 answers

Is it possible to bind to a Java Service, from a Native c++ client, and transact, receive data from the service?

I'm currently studying how binders work in general. By looking at the following projects : https://github.com/qianjigui/android_system_service_example https://github.com/cloudchou/NativeBinderJavaClientDemo I understand that binder transaction is…
6
votes
1 answer

ParcelFileDescritor.createPipe(), aka pipe(2), and security

Note that while I'm asking this in the context of Android, it's more of a general unix question w/ regard to pipe(2) ... To transfer large amounts of data from one process to another, one can use ParcelFileDescritor.createPipe(), then send the read…
Jeffrey Blattman
  • 22,176
  • 9
  • 79
  • 134
6
votes
2 answers

Android IPC maximum transaction size?

I'm making small Android applications which communicate with each other using Binder. As I know, Android Binder has a maximum transaction size (1MB). For example, TransactionTooLargeException is thrown when applications try to send bigger than 1MB…
5
votes
1 answer

Android binder generator fails

I have defined an AIDL file with my interface. Something like this: interface IResPlugin { int discoverType(); Map onClick( in int id, in Map state ); int getLayoutId(in int option); int getMeasures(); String…
hilbert
  • 171
  • 1
  • 5
5
votes
1 answer

When to call Parcel.recycle()?

I have to work with IBinders and Parcels. I've gone through all of the IBinder, Binder, and Parcel documentation and could not find anything which talks about when to call Parcel.recycle (I also never read anything that said that a parcel must be…
1
2
3
16 17