Reputation: 5134
I am trying to get user information from google account.
I am referring to this doc . I am facing problem in importing import com.google.android.gms.plus.model.people.Person;
But it showing error The method getCurrentPerson() is undefined for the type PlusClient
Code
import com.google.android.gms.plus.model.people.Person;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPlusClient = new PlusClient.Builder(this, this, this)
.setActions("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity")
.build();
}
..........................................
For getting user data code I have used
Person currentPerson = mPlusClient.getCurrentPerson();
disp_name = currentPerson.getDisplayName();
disp_url = currentPerson.getUrl();
disp_id = currentPerson.getId();
name.setText(disp_name);
url.setText(disp_url);
id.setText(disp_id);
In manifest.xml file also I have encounter an error showing
Error: No resource found that matches the given name (at 'value' with value '@integer/
google_play_services_version')
in the following line
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Do I have to enter google_play_services_version
manually ?
Upvotes: 0
Views: 393
Reputation: 19960
Based on the fact that the meta tag is not working, i would say that Google Play Services is not being linked in properly.
Make sure you've added play services as an Android library project - check each of the steps on https://developers.google.com/+/mobile/android/getting-started#step_2_configure_your_eclipse_project
Upvotes: 1