Manoj Yadav
Manoj Yadav

Reputation: 35

I need to sync gmail contact to my app

I have built app that has functionality to sync contacts from mobile's contact now i want to add gmail contact sync button that will sync contact of gmail, that we have saved in our gmail account. For this i added google-api-client-android package into my work space for google credential or auth permission but it throws error i.e.

The project was not built since its build path is incomplete. Cannot find the ---class file for java.lang.Object. Fix the build path then try building this project (resource) google-api-client-android        
-The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files   package-info.java   /google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth   line 1  Java Problem
Unable to resolve target 'android-18'   google-api-client-android       Unknown Android Target Problem

Upvotes: 1

Views: 670

Answers (2)

Henry
Henry

Reputation: 43738

This error means, you don't have API level 18 installed. Open the SDK manager and install it.

Upvotes: 1

BooleanCheese
BooleanCheese

Reputation: 635

Not possible. Get contacts from the user's installed contacts app:

https://developer.android.com/training/contacts-provider/retrieve-names.html

Try understanding why it would be a very bad idea if apps could freely check other apps for their data. You've got to use the Contacts Provider and the permissions associated with it.

Edit: on second thought, you can try this:

https://github.com/google/google-api-java-client

But you're still going through an API and asking the user for permission. I want to make it clear that there is no taking information from other apps.

Upvotes: 1

Related Questions