当前位置: 首页>>代码示例>>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;未经允许,请勿转载。