Overview
I am creating an Android application which will scan various aspects of the device (contacts, apns, emails etc)
What I would like to make possible is for 3rd party application to register with my app on install/run/boot etc - making its data available to my application.
Question
How can I access this information in a standard way? I would use some form of Interface if I was creating a typical plugin-style desktop app, but Android doesn't have this ability. I have looked into ContentProviders but the 3rd party app would need to develop a whole SQLite database to allow my app to access its data. This seems overkill.
Is there a way to achieve this?
Sure it does.
No, they do not.
ContentProvider
is a facade. You can implement one however you like."Install" won't be possible. On first run and/or at boot time will be possible.
If your application will be pulling the data, besides a
ContentProvider
or an AIDL interface, you could send a command to the third-party app viastartService()
and include an extra in theIntent
that provides a channel for the third-party app to use to send its response (e.g., aMessenger
, aPendingIntent
, aResultReceiver
).If, instead, the third-party application will be pushing data to you, I'd implement a
BroadcastReceiver
, registered in your manifest, and have the third party app send broadcasts as needed.