Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Broadcast receiver. Huge data

Tags:

java

android

Does somebody know the max size of content which I can send via broadcast? Is the content transferred in foreground? How the size of data affect on productivity of the device?

like image 719
Vyacheslav Avatar asked Jun 23 '13 15:06

Vyacheslav


People also ask

Is broadcast receiver deprecated?

What does saving battery have to do with BroadcastReceivers? With Android Nougat, the support for registering three different implicit BroadcastReceivers in your AndroidManifest was removed. With apps targeting Android O, all implicit BroadcastReceivers registered in the manifest (except these) will stop working.

What is the time limit of broadcast receiver in Android?

What is the time limit of broadcast receiver in Android? There is also a 5-10 second limit, after which Android will basically crash your app. However, you cannot reliably fork a background thread from onReceive() , as once onReceive() returns, your process might be terminated, if you are not in the foreground.

Does broadcast receiver work in background?

A broadcast receiver will always get notified of a broadcast, regardless of the status of your application. It doesn't matter if your application is currently running, in the background or not running at all.

What is the broadcast receiver in Android?

Android BroadcastReceiver is a dormant component of android that listens to system-wide broadcast events or intents. When any of these events occur it brings the application into action by either creating a status bar notification or performing a task.


1 Answers

Does somebody know the max size of content which I can send via broadcast?

I would expect you to start running into problems around the 1MB mark for the entire parceled Intent, as there are limits on Binder-based IPC, which underlies the Intent system.

How the size of data affect on productivity of the device?

Since Intent objects get copied between processes as a result of broadcasts, you will consume a fair amount of RAM while the broadcast is going on, plus a fair amount of CPU time to copy the memory between processes.

I would agree with rciovati's comment: "IHMO a few kb are "huge" for passing with Intent".

like image 137
CommonsWare Avatar answered Oct 02 '22 14:10

CommonsWare