如何从linkedIn android获得公司和指定

时间:2016-05-30 07:20:06

标签: android linkedin socialauth

我正在使用3pillars社交认证库来安卓android。

如何获得用户公司和指定。目前我正在尝试使用

String firstName=profile.getFirstName();
String lastName=profile.getLastName();
String email=profile.getEmail();
profile.getContactInfo();

null

我得到profile.getContactInfo();

1 个答案:

答案 0 :(得分:0)

选中此Android LinkedIn integration,以下代码可以为您提供帮助

try {

            final Person user_Profile = client.getProfileForCurrentUser(EnumSet.of(ProfileField.ID)); 
            person = client.getProfileById(user_Profile.getId(), EnumSet.of(
                    ProfileField.FIRST_NAME,
                    ProfileField.LAST_NAME,
                    ProfileField.PICTURE_URL,
                    ProfileField.INDUSTRY,
                    ProfileField.MAIN_ADDRESS,
                    ProfileField.HEADLINE,
                    ProfileField.SUMMARY,
                    ProfileField.POSITIONS,
                    ProfileField.EDUCATIONS,
                    ProfileField.LANGUAGES,
                    ProfileField.SKILLS,
                    ProfileField.INTERESTS,
                    ProfileField.PHONE_NUMBERS,
                    ProfileField.EMAIL_ADDRESS,
                    ProfileField.DATE_OF_BIRTH,
                    ProfileField.PUBLIC_PROFILE_URL));


            prof_name       = person.getFirstName() + " "   + person.getLastName();
            prof_headline   = person.getHeadline();
            prof_location   = person.getMainAddress();
            prof_industry   = person.getIndustry();


            return person;

        } catch (LinkedInApiClientException ex) {
            return ex;
        }