Introduction Android has a number of different types of components that a program or app can instantiate to interact with the user or other programs. Recently I've been looking at exported as an interesting way to manipulate information that other apps have stored. A content provider is what it sounds like – it creates a standard mechanism for allowing access to centralised data. An example may be a fitness tracker could allow a central database of activity which could be queried by other apps to pull out data. It is accessed in a similar way than you would access a database. A ContentResolver is instantiated and passed a path to the content provider (in the form of a content:// URI) which can then be queried, have data inserted, deleted, updated or even allow programmatic commands. This makes it easy to supply a provider for data that may not be stored in a database or can be accessed through an API. Interacting with Content Providers Only providers that have been exported can be interacted with by other apps. Those that are can be identified from an app's Manifest. The Android dumpsys command can provide a list of export content providers by querying Activity Manager using the dumpsys activity providers command. A request to a content provider can be made on the command line using the content command, for example, this which would list all the system settings: content query -uri content://settings/system The query can be tuned with a -where clause and can restrict the…Read More
Android Content Providers 101

