简体   繁体   中英

If my app created a Android Content Provider, will the provider disappear if my app gets uninstalled?

I want to store some data in the content provider, so some of my other apps will be able to access the info as well. But my question is if the app I use to write the content provider gets uninstalled, does it mean that the content provider is gone as well? If so, is there anyway to prevent that, or is there alternative place I can store date to share across multiple apps? And one more question, is there something similar to pasteboard in iOS for android?

Thanks!

After a round search and testings, I have found the answer myself.

Well, it depends. There are 2 ways of using/changing Content Provider

  1. To make changes the default content provider, such as contacts. If your app added an entry of contact, the contact is still there even the app gets deleted

  2. To make your own content provider. But this gets removed when the app gets uninstalled.

But my question is if the app I use to write the content provider gets uninstalled, does it mean that the content provider is gone as well?

By definition, if you remove the content provider, the content provider is removed.

If so, is there anyway to prevent that

No. Users are free to uninstall whatever they like that they installed.

is there alternative place I can store date to share across multiple apps?

External storage, or the Internet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM