Android private content provider?
Asked Answered
G

2

19

I am developing an application that involves some sensitive user information. I retrieve this information via a private web API. I am trying to determine the best way to get this data into my app. Right now I'm exploring creating a content provider that can do so; my hesitation is in making it secure. I want this data to be usable only by my application. Ideally, no other apps would even know it exists.

Do you have any pointers or advice on how to do this effectively and securely? Any info on content providers who's data source is a remote OAuth'd API?

Thanks!

Edit: I say content provider, but if that isn't the best way to do what I need, by all means let me know what else to look into.

Gasconade answered 28/9, 2010 at 15:51 Comment(0)
F
38

Try android:exported="false" in your manifest.

Frisse answered 28/9, 2010 at 17:7 Comment(0)
A
3

Why even consider a ContentProvider? As far as I know ContentProviders are meant to share data with other applications. I would suggest writing a utility class to interface with your storage of the sensitive data, be it SQLite or whatever.

-Dan

Amends answered 28/9, 2010 at 17:39 Comment(4)
A content provider just seemed to be the way to go. I am very much not opposed to an alternative solution that utilizes more appropriate components.Gasconade
The utility class I suggested would be an acceptable solution in my eyes. It would manage your database connection and storage / retrieval / encryption of the data in the database. When I say "utility class", I really mean just a regular old Java class. I don't believe there is anything Android-specific you can use that would fulfill what you are looking for.Amends
As a reference, check the answer why a private contentProvider would be more suitable than a custom utility class! #5524011 and groups.google.com/group/android-developers/browse_thread/thread/…Chandigarh
If you're using the LoaderManager it requires a Content Provider URI in order to get data.Toupee

© 2022 - 2024 — McMap. All rights reserved.