How to secure my application contacts like Facebook - android

When you try to retrieve contacts from device , you generally get contacts created by all applications except Facebook. This question describes it.
So , what would I need to do when I'm storing contacts through my applications(using ContactsContract?), so that other applications won't be able to retrive it through ContactsContract ..but they are still available to device contacts application... or to the applications that I choose ?

Facebook contacts are synced using a different implementation of the Contacts API. Google used to provide a special case for this, but no longer does. The different hardware manufacturers that do support it customize their Contacts application for this specific use. This is why Facebook contact sync works on most phones besides the Nexus series. These are private implementations, but I'm sure can be reverse engineered if you're willing to sort through lots of obfuscated code.

Related

What is the right way to work with gmail address book on Android?

I'm actively learning Android platform at the moment and decided to write a simple app for myself to manage my gmail emails and contacts. At first I was going to use Gmail SDK but after reading docs and examples I didn't find any nice way to get all my contacts for my gmail account. After some search I found Google Contact API but it looks pretty complex and over featured for my needs. It seems it can manage any sort of contacts in any possible ways but I just want manage email addresses.
I'd like to keep things as simple as possible and I want use only one API\SDK. It looks quite weird that Gmail SDK allows manage email labels or create email drafts or send emails but there is nothing in it for contacts management. Does anybody know if there is a better way then use both Gmail SDK and Contact API together? May be Gmail SDK can manage contacts some way?
UPDATE: I've just tried to get all my emails using Gmail SDK and extract all contacts from them. It worked but this is pretty long and not convenient process.

How to have other apps know what CONTENT_URI to look for?

I have been researching everything I can on Content Providers, but I cannot grasp the concept of how other apps installed on the phone can have access to the Content I am Providing.
How can other apps possibly know what my CONTENT_URIs are???
I am making a Contacts app. How can other apps get the contact data I have stored, it seems impossible another app would know what I have set for the CONTENT_URI.
Doesn't this defeat the whole purpose of Content Providing if other apps need to know basically what the secret key is that only I would know?
I want other apps to see my Contact app data instead of ignoring mine and only looking to the stock Contacts app for data.
Why would Android create the ContactsContract provider if that is going to lead to developers using that to obtain contact data, therefore by default making all other 3rd party contacts apps obsolete because other developers would be writing code essentially to only grab Contact data from the stock Android Contact app?
Android doesn't seem to provide anyway for me to provide by data to other apps using the ContactsContracts provider. Yet of coarse Android has made it very clear, easy, and encourages developers needing contact data to use ContactsContract.
Is this a blatant power grab? The whole intention of my contacts app is to make my Contact data more secure so that Google isn't able to collect it if they so choose, or anyone else for that matter.
Please can someone advise? This cannot possibly be correct, I am hoping I have misunderstood here. Again just FYI, I have found nothing anywhere on the Android Developer page that refers to the issue I am having.
This is definitely not a power grab. The contacts are embedded into the operating system because users require their phone to store phone numbers along with a name and other information to associate with that phone number. Google is not doing anything different than the flip phones did back in the day, except for giving users the option to sync their contacts to the cloud. However, that is not required. A user can add a contact to their phone and simply have it pertain to the phone.
The ContactsContract allows apps to access the contacts stored on the device, which is only possible after the user gives permission to the app to access their contacts. There are apps that use this functionality to act as contacts managers (apps that display the user's contacts in a different layout). Some apps provide the user with the service of backing up their contacts online in case the user did not want to use Google (e.g. FullContact). However, the majority of apps typically read contacts for other reasons, such as helping the user find friends/acquaintances/coworkers/etc who have an account in their app.
To address the issue of how other developers realize an app's CONTENT_URI, they do so by reading the developers' documentation. If you are the developer providing content, then it is your responsibility to publish the necessary documentation in order to let other developers understand how to work with your app.

Android Wear Access Contacts

I have an app that interfaces extensively with the contacts ContentProvider. I am looking to introduce a Wear component to my app that will make use of contact data.
Is Wear able to directly access the contacts through a ContentResolver or does it have to be manually synced from the mobile device?
There is no such an API allows you to directly read contacts of your phone. You may have to consider the wearable app as a separate app from you phone side app. You should sync the contacts using the Data Layer Api.

how to create android app to take backup of the phone

How To create backup of phone data and in case of lost should retrieve data on another phone from server side database,i want to develop android
With the updated information (contacts backup) I would advise the following:
Connect the android phone with a google account, all contacts will be saved with the google account and available on other phones registered with that account. Can have multiple accounts. Available in gmail/google contacts as well. Works with google apps accounts as well as gmail.
and/or
Connect the android phone with an exchange server, can store the contacts there and will be available on other phones connected as well
The power of the cloud (and android). You already have backup of your contacts.
Contacts from one or more of each of these for example are available (and merged into one contact): skype, twitter, gmail, exchange, endomondo, ...(even facebook is possible with workarounds even though facebook ignores the integration on android themselves these days) and many others. Android is very nice regarding this!
Having said that, there is a contacts api and fairly easy to access using standard android content resolvers etc. Please see
http://developer.android.com/resources/articles/contacts.html

Is it possible to receive notifications when a contact is added on the iOS and Android platforms?

Question says it all. Looking for a way for a custom app to be able to keep track within minutes of when a contact has been added to the built in contacts database on both of these platforms. For example, if I get an email on my iPhone, and add the sender to my contacts, I'd like for the custom app to be able to know that within a minute at most.
Are there hooks for this? Naturally it would require the user authorizing the custom app to have access to this information.
There aren't any hooks for this in iOS. You can access the address book, but only when your application is running.

Categories

Resources