I have two applications which use the same content provider, but I can\'t put the same content provider in both applications- it shows INSTALL_FAILED_CONFLICTING_PROVIDER er
One solution i can think of is, make content provider part of both the applications with different packageid's internally.and export it using android:exported = true. Both might be using the same code though.
At the start of the application you check if the other content provider exists on the device if it's there you start using it,otherwise you fallback to local content provider. when the other applicaton installs it can does the same check.
To protect your cotent provider from everyone else, you can define a custom permission to protect it, so that your applications can only use it or you can also put some custom authentication like some secret key to access the content provider. you can have this authentication code in all methods of content provider.