title: Shared Content Provider
body: <p>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. </p>
  
  <p>It should be designed keeping the following in mind</p>
  
  <ul>
  <li>Data created by any version should be visible in the other version instantly</li>
  <li>as I understand, both the pro and free versions cannot declare the <a href="https://stackoverflow.com/questions/3306639/multiple-apps-use-same-content-provider">same content provider in the manifest file</a></li>
  <li>Keeping the last point in mind, I need to create separate providers for the free and pro versions</li>
  </ul>
  
  <p>Possible solutions:</p>
  
  <ul>
  <li>Create two content providers, one created by the free version, the other by the pro version</li>
  <li>When the pro version is first launched, if there is any data in the free version, copy that to the pro version</li>
  <li>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 </li>
  <li>Set the android:protectionLevel attribute to "signature" so that both the versions can access both Content Providers</li>
  </ul>
  
  <p>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.</p>