本文整理匯總了Java中com.google.android.gms.plus.model.people.Person.getUrl方法的典型用法代碼示例。如果您正苦於以下問題:Java Person.getUrl方法的具體用法?Java Person.getUrl怎麽用?Java Person.getUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.plus.model.people.Person
的用法示例。
在下文中一共展示了Person.getUrl方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getProfileInformation
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
/**
* Fetching user's information name, email, profile pic
* */
private void getProfileInformation() {
ringProgressDialog.dismiss();
if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
Person currentPerson = Plus.PeopleApi
.getCurrentPerson(mGoogleApiClient);
String personName = currentPerson.getDisplayName();
String personPhotoUrl = currentPerson.getImage().getUrl();
String personGooglePlusProfile = currentPerson.getUrl();
String birth = currentPerson.getBirthday();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
// by default the profile url gives 50x50 px image only
// we can replace the value with whatever dimension we want by
// replacing sz=X
// personPhotoUrl = personPhotoUrl.substring(0,
// personPhotoUrl.length() - 2)
// + PROFILE_PIC_SIZE;
//new LoadProfileImage().execute(personPhotoUrl);
} else {
Toast.makeText(getApplicationContext(),
"Person information is null", Toast.LENGTH_LONG).show();
}
}
示例2: getProfileInformation
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public void getProfileInformation() {
Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
Person currentPerson = Plus.PeopleApi
.getCurrentPerson(mGoogleApiClient);
String personName = currentPerson.getDisplayName();
String personPhotoUrl = currentPerson.getImage().getUrl();
String personGooglePlusProfile = currentPerson.getUrl();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
textView_name.setText(personName);
textView_email.setText(email);
// by default the profile url gives 50x50 px image only
// we can replace the value with whatever dimension we want by
// replacing sz=X
personPhotoUrl = personPhotoUrl.substring(0,
personPhotoUrl.length() - 2)
+ 400;
new LoadProfileImage(imageView_profile_image).execute(personPhotoUrl);
Toast.makeText(getApplicationContext(),
"Information is loaded", Toast.LENGTH_LONG).show();
}
示例3: getProfileInformation2
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public void getProfileInformation2() {
Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
Person currentPerson = Plus.PeopleApi
.getCurrentPerson(mGoogleApiClient);
String personName = currentPerson.getDisplayName();
String personPhotoUrl = currentPerson.getImage().getUrl();
String personGooglePlusProfile = currentPerson.getUrl();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
Drawer_textView_name.setText(personName);
drawer_textView_email.setText(email);
// by default the profile url gives 50x50 px image only
// we can replace the value with whatever dimension we want by
// replacing sz=X
personPhotoUrl = personPhotoUrl.substring(0,
personPhotoUrl.length() - 2)
+ 400;
new LoadProfileImage3(drawerImageProfile).execute(personPhotoUrl);
Toast.makeText(getApplicationContext(),
"Information is loaded in Nav_drawer", Toast.LENGTH_LONG).show();
}
示例4: getProfileInformation
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
/**
* Fetching user's information name, email, profile pic
*/
private void getProfileInformation() {
try {
if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
Person currentPerson = Plus.PeopleApi
.getCurrentPerson(mGoogleApiClient);
String personName = currentPerson.getDisplayName();
String[] wholeName = personName.split(" ", 2);
String firstName = wholeName[0];
String lastName = wholeName[1];
String personGooglePlusProfile = currentPerson.getUrl();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
new SocialLoginTask(LoginFragment.this, getActivity())
.execute("google",
firstName,
lastName,
personGooglePlusProfile,
email);
} else {
Toast.makeText(mContext,
"Person information is null", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: onPlusClientSignIn
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
@Override
protected void onPlusClientSignIn() {
mConnectionProgressDialog.dismiss();
session = new SessionManager(this);
if (getPlusClient().getCurrentPerson() != null) {
String accountName = getPlusClient().getAccountName();
Person currentPerson = getPlusClient().getCurrentPerson();
String personName = currentPerson.getDisplayName();
String personPhotoUrl = currentPerson.getImage().getUrl();
String personGooglePlusProfile = currentPerson.getUrl();
String personGooglePlusId = currentPerson.getId();
String location = currentPerson.getCurrentLocation();
session.createLoginSession(personName, accountName, personPhotoUrl, personGooglePlusProfile, personGooglePlusId, location);
}
Toast.makeText(this, "Welcome to ListSketcher!", Toast.LENGTH_LONG).show();
Intent i = new Intent(this, MainActivity.class);
// Closing all the Activities
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// Add new Flag to start new Activity
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
finish();
}
示例6: onConnected
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
@Override
public void onConnected(Bundle connectionHint) {
mSignInClicked = false;
doIfLoggedIn();
if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
String personName = currentPerson.getDisplayName();
//String personPhoto = currentPerson.getImage();
// String personGooglePlusProfile = currentPerson.getUrl();
// String imageUrl = currentPerson.getImage().getUrl();
//String cover = currentPerson.getCover().getCoverPhoto().getUrl();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
Toast.makeText(this, "User is connected: " + personName + " | Email: " + email, Toast.LENGTH_LONG).show();
ArrayList<String> list = showAllMethodsWithValues(currentPerson);
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);
listView.setAdapter(adapter);
if(currentPerson.hasCover())
new ImageLoaderTask().execute(currentPerson.getCover().getCoverPhoto().getUrl());
else if(currentPerson.hasImage())
new ImageLoaderTask().execute(currentPerson.getImage().getUrl());
String details = "";
details += "getId = " + currentPerson.getId() + " \n";
details += "getAboutMe = " + currentPerson.getAboutMe() + " \n";
details += "getBirthday = " + currentPerson.getBirthday() + " \n";
details += "getBraggingRights = " + currentPerson.getBraggingRights() + " \n";
details += "getCurrentLocation = " + currentPerson.getCurrentLocation() + " \n";
details += "getDisplayName = " + currentPerson.getDisplayName() + " \n";
details += "getLanguage = " + currentPerson.getLanguage() + " \n";
details += "getNickname = " + currentPerson.getNickname() + " \n";
details += "getTagline = " + currentPerson.getTagline() + " \n";
details += "getUrl = " + currentPerson.getUrl() + " \n";
details += "getAgeRange = " + currentPerson.getAgeRange() + " \n";
details += "getCircledByCount = " + currentPerson.getCircledByCount() + " \n";
details += "getCover = " + currentPerson.getCover() + " \n";
details += "getGender = " + currentPerson.getGender() + " \n";
details += "getImage = " + currentPerson.getImage() + " \n";
details += "getName = " + currentPerson.getName() + " \n";
details += "getObjectType = " + currentPerson.getObjectType() + " \n";
details += "getOrganizations = " + currentPerson.getOrganizations() + " \n";
details += "getPlacesLived = " + currentPerson.getPlacesLived() + " \n";
details += "getPlusOneCount = " + currentPerson.getPlusOneCount() + " \n";
details += "getRelationshipStatus = " + currentPerson.getRelationshipStatus() + " \n";
details += "getUrls = " + currentPerson.getUrls() + " \n";
details += "getOrganizations = " + currentPerson.getOrganizations() + " \n";
txtDetails.setText(details);
}
}
示例7: onConnected
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
/**
* Sends the user data received from the SignInActivity to the server-side.
*
* @param connectionHint the connection hint
*/
public void onConnected(Bundle connectionHint) {
if (!flag) {
try {
if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
Person person = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
String gender;
if (person.getGender() == 0) {
gender = "male";
} else {
gender = "female";
}
final String user = "{" +
"\"email\": \"" + email + "\"," +
"\"family_name\": \"" + person.getName().getFamilyName() + "\"," +
"\"gender\": \"" + gender + "\"," +
"\"given_name\": \"" + person.getName().getGivenName() + "\"," +
"\"id\": \"" + person.getId() + "\"," +
"\"link\": \"" + person.getUrl() + "\"," +
"\"locale\": \"" + person.getLanguage() + "\"," +
"\"name\": \"" + person.getDisplayName() + "\"," +
"\"picture\": \"" + person.getImage().getUrl().substring(0, person.getImage().getUrl().length() - 6) + "\"," +
"\"verified_email\": " + person.hasVerified() +
"}";
flag = true;
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
view.clearCache(true);
webView.loadUrl("javascript:requestRouter('SignInRouter', { \"user\": " + user + " })");
}
});
} else {
Toast.makeText(getApplicationContext(), "Person information is empty", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}