My application has two versions, a free and pro version and the Content Provider for the app data needs to be shared between the two.
It should be designed keeping the following in mind
- Data created by any version should be visible in the other version instantly
- as I understand, both the pro and free versions cannot declare the same content provider in the manifest file
- Keeping the last point in mind, I need to create separate providers for the free and pro versions
Possible solutions:
- Create two content providers, one created by the free version, the other by the pro version
- When the pro version is first launched, if there is any data in the free version, copy that to the pro version
- Whenever any data is written in the free or pro version, I should check if the other version of Content Provider exists or not, and write to both the Content Providers if they exist
- Set the android:protectionLevel attribute to "signature" so that both the versions can access both Content Providers
Please let me know if this makes sense and follows best practices with respect to shared content providers. Do share any other ways of doing this.