Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>Service messaging or AIDL is out of the question because it always has an asynchronous part to it (as well as Intents).</p> </blockquote> <p>Binding to an AIDL-based service is asynchronous, but that is done once up front. Calling an AIDL-defined method is synchronous.</p> <blockquote> <p>I also thought of ContentProvider but it seems a little bit exaggerated/bloated just for this.</p> </blockquote> <p>Most of your choices will be similarly "exaggerated/bloated just for this". </p> <blockquote> <p>am I missing anything</p> </blockquote> <p>You could use broadcast <code>Intents</code> to push changes to the value, particularly if the value does not change frequently. The challenge here is bootstrapping the initial value (e.g., App B is installed and needs the value from App A, but has to wait until the value changes and App A sends the broadcast). However, this might be worth considering if you will be reading the value a lot, as doing an IPC per read may add more overhead than it is worth.</p> <p>Also, you may wish to reconsider whether having this dependency is a good idea in the first place. Using the nomenclature from my preceding paragraph, App B perhaps cannot exist without App A, if it needs some value maintained by App A. Since the user can uninstall App A at any point, this could cause problems. Also, if this flag is meant as some sort of control mechanism (e.g., please don't do X while the other app is doing Y), you will have problems, particularly on multi-core devices where both processes might truly be running simultaneously.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload