I am trying to make an android app based on google-fit.
What I am trying to achieve is that I create an account for the user on my website as soon as the user chooses an account using the app.
Here is the code base that I want to build up upon (It is just the basic registration sample code) https://github.com/ishanatmuz/GoogleFitTest/tree/829051b7739ee9d8871c3ba9e5f21dfb17f4f3d7
onConnected is called when the user has succesfully signed in and provided the permissions. I am calling my own function to do further work which is basically this :
I need help figuring out how to do the step 1.
Any help will be greatly appreciated.
On your onConnected()
method, you can get it with:
Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
String personName = currentPerson.getDisplayName();
String accountName = Plus.AccountApi.getAccountName(mGoogleApiClient);