views:

446

answers:

1

Hi All,

I want to encrypt individual contacts stored by the Contacts application on Android based on user's preference. So, I am thinking I'll have to hook/extend the Contacts application before the it stores data into the database and decrypt it when the user wants to view it. Also, I am assuming I will have to store the key for encryption in a file. Can anybody suggest how to go about it?

Thanks!

A: 

Your goal, while admirable, is impractical. There is no "Contacts application". Android has a standard Contacts content provider and related activities. That has been replaced by HTC (on Sense-enabled devices), by Motorola (on MOTOBLUR-enabled devices), and perhaps other OEMs as well. Combine that with the fact that there is no "hook/extend" mechanism for any of them, and I do not see how you can create what you are looking for.

The Android 2.0 revised Contacts API, particularly with multiple accounts, may give you more options. It may be you have to create some sort of account that represents your encrypted contacts, and you might have the hooks to do that. However, I have not had an opportunity to dig into the new API enough to say for certain whether this approach is or is not feasible. And, it still assumes that OEMs stop replacing the native Contacts stuff with their own, and that's far from certain.

CommonsWare
Thank you for the info!
android.dev