I developed an App and i executed some tests. This tests consists in sending data from one background service to another background service. All data was received when the transmission rate was low (4 intents/second). However when i increased the transmission rate (8 and 12 intents/second), some data (typically 2- 3 %) was not received by the destination service.
All intents were broadcasted and the services were running locally.
Can anyone tell me, how the OS treats the Intents and the whole mechanism works, in order to find the reason why data was not received by it's receiver ?
Best regards,
An Intent object carries information that the Android system uses to determine which component to start (such as the exact component name or component category that should receive the intent), plus information that the recipient component uses in order to properly perform the action (such as the action to take and the ...
Android Intent is the message that is passed between components such as activities, content providers, broadcast receivers, services etc. It is generally used with startActivity() method to invoke activity, broadcast receivers etc. The dictionary meaning of intent is intention or purpose.
Intent is to perform an action. It is mostly used to start activity, send broadcast receiver, start services and send message between two activities. There are two intents available in android as Implicit Intents and Explicit Intents.
First of all, I would rather recommend to bind the service and then using Handlers for IPC. A good example can be found here: http://developer.android.com/guide/components/bound-services.html This is a lot faster and more reliable.
On how Intents work internally you can have a look at the source code: https://github.com/android/platform_frameworks_base/blob/master/core/java/android/app/ContextImpl.java#L893
Here are the relevant methods (you can see the first one geting called from the ContextImpl.broadcastIntent() method, see the link in Force's answer):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With