Is there a way to programmatically list all available content providers on a device? No real use case, I just thought it might be neat to see what apps I have installed on
List providers = getContext().getPackageManager()
.queryContentProviders(null, 0, 0);
lists all content providers available to you on this device.
Or, if you know the process name and UID of the provider, you can reduce the list by specifying those two parameters. I have used this before to check the existence of my own content providers, more specifically those of previous (free vs. paid) installations:
List providers = getContext().getPackageManager()
.queryContentProviders("com.mypackage", Process.myUid(), 0);
Note the android.os.Process.myUid() to get my own process's user ID.