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.
Related
In my application, I want to view data of some of the other android apps(health apps) which are installed on the phone. I know ContentProvider & ContentResolver classes provides this funcationality.
What if some applications do not share their data? How to pair with such apps?
For example how do I pair 'Runtastic' app with my application, pairing as in I want to open another health app(installed on phone) in my application on some button click, also want to access it's wellness related data(steps count)?
Has anybody implemented this kind of functionality?
Android device should be rooted. Without root, you can't access these data.
Content provide and content resolver provide data through implicit intents and you can not access data or other app installed on phone until its api is provided.
In a normal android app ,we can code and create a sqlite database for an android app,But when we are putting this app on play store and multiple users are using that app, then how can we provide same kind of data to all users as database(sqlite) we made is only to that user in his phone.
I am new to android programming so not sure how to maintain a centralized database.
If you want centralized data for all users of your app, regardless of the device, then you'll need to use a cloud type API (e.g. web app backend accessed via REST API). Anything you put in a SQLite database on the device will only be accessible by that app on that specific device and for that specific person. On Android devices with multiple people, such as a tablet with multiple profiles, each person gets a separate instance of your app and data.
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.
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
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.