Using Intents or an event bus to communicate within the same app

I understand how to use Intents to communicate with the system/other apps. I understand how to use Intents within the same App. I also understand how to use Otto to communicate within the same App.

What are the Pro/Cons of using Otto vs. Intents to communicate between my Activities/Services?

  • How can you access the contents of Android Emulator databases?
  • window.open event listeners not working in Android 4.4.2
  • Can't find “Sync Project with Gradle Files” button in IntelliJ IDEA
  • Passing caption to Instagram with Android Intent Stopped Working?
  • Android on virtualBox gets stuck after idle
  • Documentation for styles in android resources
  • Related posts:

    How it is possible Service run indefinitely and also allow binding in android?
    Is there some “Feature Graphic” generator for Google Play?
    How to implement an audio player for Android using MediaPlayer And MediaController?
    java.lang.NoSuchMethodError when use getFragmentManager() with actionbarsherlock library
    How to change android keyboard key font?
    adb logcat cordova android 4
  • Setting splitActionBarWhenNarrow from Java on Android
  • How to use google map V2 inside fragment?
  • Expandable listview inside scrollview
  • Android ssl: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate (yet again)
  • java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState:- Error in Fragment
  • android espresso testing : empty test suite. no tests were found
  • One Solution collect form web for “Using Intents or an event bus to communicate within the same app”

    Pros for using Otto:

    • You get to design your own event types, versus having to use custom actions or something to distinguish one Intent from another

    • Everything is within your own process (contrast with startActivity() and kin, which always involve IPC, even if the activity you are starting is in your own app), for speed and security

    • A bit less coding, as you aren’t having to instantiate IntentFilter or BroadcastReceiver objects

    • It offers the producer pattern (as a quasi-replacement for sticky broadcasts)

    • Being not part of the OS, it has the potential to be updated more frequently

    Cons for using Otto:

    • It cannot start an activity

    • It cannot start a service

    • It cannot bind to a service

    • It cannot send a broadcast

    • It cannot be used in a PendingIntent or for any true IPC

    IOW, the true comparison for Otto is with LocalBroadcastManager, not with the general use of Intents.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.