0

How can I restrict that applications can access only that data from SQL lite (android database) that I allow them? for example- I want that my selected contacts from the contact list should not be accessed by any application running on the phone? I am making an application which when run, will hide the selected contacts even from the default contact viewer application provided by the Android.

Zubair
  • 304
  • 1
  • 5
  • 19
  • 3
    Its default! Your database will not be accessible to other application unless and until you dont write Content Provider wrapper for them. – Vipul Nov 14 '12 at 11:08
  • Thank you @Vipul Shah, I have completed my question now. Hope it will be understood correctly now. – Zubair Nov 14 '12 at 13:01

1 Answers1

0

All contacts in the system contacts database are accessible to all apps (that got the right to access them).

If you want to hide contacts, you have to store them in your own, private database.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • what if I want to hide all of my messages? Do I need to copy all messages to private database? – Zubair Nov 15 '12 at 10:04
  • There is no difference between contacts and messages in this regard. – CL. Nov 15 '12 at 10:06
  • Thank you The gallery items go to the same category? – Zubair Nov 15 '12 at 10:08
  • <*sigh*> All data that is available to all apps is available to all apps. – CL. Nov 15 '12 at 10:10
  • But that would not be an efficient way to do Sir! If user wants to hide too many contacts or messages it would take long time to move the selected item to new database as well as we have to delete it from the old database, what If application crashes? The user would lose all its messages and contacts.. Is there any other possible way? To set flags any type of flags on the database.?? – Zubair Nov 15 '12 at 10:15
  • The built-in Andorid databases have no such flags (other than the rights given to apps on installation). – CL. Nov 15 '12 at 14:06