當前位置: 首頁>>代碼示例>>Java>>正文


Java Person.getUrl方法代碼示例

本文整理匯總了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();
        }
    }
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:29,代碼來源:LoginActivity.java

示例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();
    }
 
開發者ID:tarasM,項目名稱:Bozon.kg_App,代碼行數:24,代碼來源:My_Private_Profile.java

示例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();
    }
 
開發者ID:tarasM,項目名稱:Bozon.kg_App,代碼行數:24,代碼來源:Drawer.java

示例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();
    }
}
 
開發者ID:ITsvetkoFF,項目名稱:Kv-009,代碼行數:29,代碼來源:LoginFragment.java

示例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();

}
 
開發者ID:gangeshwark,項目名稱:listsketcher,代碼行數:28,代碼來源:LoginPref.java

示例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);
    }
}
 
開發者ID:hishamMuneer,項目名稱:Android-Design-Support-Library,代碼行數:54,代碼來源:GoogleLoginActivity.java

示例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();
		}
	}
}
 
開發者ID:richardsolomou,項目名稱:atmos-hybrid-app,代碼行數:51,代碼來源:MainActivity.java


注:本文中的com.google.android.gms.plus.model.people.Person.getUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。