How to get a value from another android application?
-
19-04-2021 - |
Frage
I'm building 2 applications.
The first application, on start, asks a value (for example an integer) to the second application, which may or may not be installed and may or may not be running.
I don't think shared files or preferences are the best option, because I want to provide different output when the second application is present or not.
Should I use Intents? Content provider? Anything else?
Lösung 2
I solved by creating an Intent with putExtra and finish() (to return to first app). 4 lines of code on each app.
Andere Tipps
Use Intents and Activities, if you want to retrieve a user entered value, or something that requires user interaction.
ContentProvider would also work, depending on your requirements.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow