有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何替换Plus。新playservicesauth:8.3.0和googleservices:1.5.0beta2中的PeopleApi?

关于这个话题我有一些问题。我想知道使用Google Plus帐户登录我的Android应用程序的人的性别,但我找到的每个示例都使用以下内容:

if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {

        Person currentPerson = Plus.PeopleApi
                .getCurrentPerson(mGoogleApiClient);
        String personName = currentPerson.getDisplayName();         

        try {
            int genderInt = currentPerson.getGender();
         String   gender     = String.valueOf(genderInt);
        String birthday = currentPerson.getBirthday();

        System.out.println("gender" + gender + "bod" + birthday);

        } 


        catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }       

        String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
    }

他们使用加号。PeopleApi在新的play服务auth:8.3.0和google服务1.5.0-beta2中不再存在。我想知道新的API是如何取代它的,或者哪种是检索性别和其他个人资料数据(如出生日期)的新方法

谢谢


共 (0) 个答案