Is EventBus suitable for the tasks I am trying to complete? I need a callback whenever any application prints a document.
Asked
Active
Viewed 134 times
0
-
As far as I know you will only be notified of the job finish event in onFinish callback: https://developer.android.com/reference/android/print/PrintDocumentAdapter.html#onFinish() if you're using the PrintDocumentAdapter to print – Nonos Mar 21 '18 at 19:18
-
I am aware of PrintDocumentAdapter, but it only works inside of the application for the documents I decide to print. I am looking for a system level (device level) notification on print from any application on the device. – Dejan Mauer Mar 22 '18 at 12:03
2 Answers
0
Yes it is good for getting callback.
But if you only need to use it single time then do not use EventBus
library for that, you can use BroadcastReceiver or our own defined interface listener.
Because for using one time the library is not a good idea. If There are many use of callbacks then No-doubt EventBus
is best.

Vishal Chhodwani
- 2,567
- 5
- 27
- 40
0
I need a callback whenever any application prints a document.
Android does expose this information to apps.
Is EventBus suitable for the tasks I am trying to complete?
No, insofar as an event bus does not cause Android to provide you with information that it otherwise would not.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
I am not aware of the exposed interface for getting notified when other applications sends something on printer. I am able to control my application, but I would like to get informed whenever printing occurs on system level. – Dejan Mauer Mar 22 '18 at 12:05
-
@DejanMauer: That will require a custom ROM, or possibly a rooted device and some type of Xposed module. – CommonsWare Mar 22 '18 at 12:12