I have a solution for this, I used the following code snippet to get more detailed information for the user, and now it gives everything correctly,
Person profile = client.getProfileForCurrentUser(EnumSet.of( ProfileField.ID, ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.HEADLINE, ProfileField.INDUSTRY, ProfileField.PICTURE_URL, ProfileField.DATE_OF_BIRTH, ProfileField.LOCATION_NAME, ProfileField.MAIN_ADDRESS, ProfileField.LOCATION_COUNTRY)); System.out.println("PersonID : " + profile.getId()); System.out.println("Name : " + profile.getFirstName() + " " + profile.getLastName()); System.out.println("Headline : " + profile.getHeadline()); System.out.println("Industry : " + profile.getIndustry()); System.out.println("Picture : " + profile.getPictureUrl()); DateOfBirth dateOfBirth = profile.getDateOfBirth(); System.out.println("DateOfBirth : " + dateOfBirth.getDay() + "/" + dateOfBirth.getMonth() + "/" + dateOfBirth.getYear()); System.out.println("MAin Address : " + profile.getMainAddress()); Location location = profile.getLocation(); System.out.println("Location:" + location.getName() + " - " + location.getCountry().getCode());
Chirag_CID
source share