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


Java Person.getId方法代碼示例

本文整理匯總了Java中com.google.android.gms.plus.model.people.Person.getId方法的典型用法代碼示例。如果您正苦於以下問題:Java Person.getId方法的具體用法?Java Person.getId怎麽用?Java Person.getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.plus.model.people.Person的用法示例。


在下文中一共展示了Person.getId方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Builder

import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
@Deprecated
public Builder(Activity paramActivity, PlusClient paramPlusClient)
{
  this(paramActivity);
  boolean bool;
  if (paramPlusClient != null)
    bool = true;
  else
    bool = false;
  eg.a(bool, "PlusClient must not be null.");
  eg.a(paramPlusClient.isConnected(), "PlusClient must be connected to create an interactive post.");
  eg.a(paramPlusClient.eK().az("https://www.googleapis.com/auth/plus.login"), "Must request PLUS_LOGIN scope in PlusClient to create an interactive post.");
  Person localPerson = paramPlusClient.getCurrentPerson();
  String str;
  if (localPerson != null)
    str = localPerson.getId();
  else
    str = "0";
  this.mIntent.putExtra("com.google.android.apps.plus.SENDER_ID", str);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:21,代碼來源:PlusShare.java

示例2: setRecipients

import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public Builder setRecipients(Person paramPerson, List<Person> paramList)
{
  Intent localIntent = this.mIntent;
  String str;
  if (paramPerson != null)
    str = paramPerson.getId();
  else
    str = "0";
  localIntent.putExtra("com.google.android.apps.plus.SENDER_ID", str);
  return setRecipients(paramList);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:12,代碼來源:PlusShare.java

示例3: if

import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public ℴ(Person paramPerson)
{
  this.ˊ = paramPerson.getId();
  this.ˋ = paramPerson.getDisplayName();
  this.ˎ = paramPerson.getImage().getUrl();
  if (this.ˎ == null)
    this.ˎ = "";
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:9,代碼來源:‚Ñ¥.java

示例4: 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

示例5: Contact

import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public Contact(Person person) {
    // persons are loaded with image, id and display name so no need in null-checks
    this.imageUrl = person.getImage().getUrl();
    this.displayName = person.getDisplayName();
    this.googleId = person.getId();
}
 
開發者ID:asmolko,項目名稱:MyDebts,代碼行數:7,代碼來源:Contact.java

示例6: onConnected

import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
@Override
public void onConnected(Bundle bundle) {
    if (operationLogin) {
        Person person = Plus.PeopleApi.getCurrentPerson(googleApiClient);
        final String id = person.getId();
        final String displayName = person.getDisplayName();
        final Person.Image image = person.getImage();
        final String imageUrl = image.hasUrl() ? image.getUrl() : null;
        final String accountName = Plus.AccountApi.getAccountName(googleApiClient);
        new AsyncTask<Void, Void, Void>() {
            AuthData authData;
            Exception cause;

            @Override
            protected Void doInBackground(Void... params) {
                try {
                    String token = GoogleAuthUtil.getToken(activity, accountName, "oauth2:" + Plus.SCOPE_PLUS_LOGIN);
                    authData = createAuthData(id, token, displayName, imageUrl);
                } catch (IOException | GoogleAuthException e) {
                    cause = e;
                }
                googleApiClient.disconnect();
                return null;
            }

            @Override
            protected void onPostExecute(Void aVoid) {
                super.onPostExecute(aVoid);

                if (cause != null) {
                    onError(createAuthError(cause));
                } else {
                    onSuccess(authData);
                }
            }
        }.execute();
    } else {
        Plus.AccountApi.clearDefaultAccount(googleApiClient);
        Plus.AccountApi.revokeAccessAndDisconnect(googleApiClient).setResultCallback(new ResultCallback<Status>() {
            @Override
            public void onResult(Status status) {
                googleApiClient.disconnect();
                if (status.isSuccess()) {
                    onSuccess(createAuthData());
                } else if (status.isCanceled()) {
                    onCancelled(createAuthCancel());
                } else {
                    onError(createAuthError(status.getStatusMessage()));
                }
            }
        });
    }
}
 
開發者ID:bbqapp,項目名稱:bbqapp-android,代碼行數:54,代碼來源:GooglePlus.java

示例7: 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

示例8: 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.getId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。