2

I am trying to get the Connections or user's friends info from LinkedIn using LinkedIn jar for android and example given in google code, but i wont get Connections using linkedInApiClient.getConnectionsForCurrentUser() this method call it returns null, but i can access user current profile info using linkedInApiClient.getProfileForCurrentUser()

can any body suggest me how to get User connections information in linkedIn in android. Or guide me the the wright way.

Animesh Sinha
  • 1,045
  • 9
  • 16
  • You can get connections of linked in using socialauth android version.
    [Click here to get socialauth android](http://code.google.com/p/socialauth-android/)
    – Tarun Nagpal Jan 11 '13 at 14:29

1 Answers1

8

I got the solution for the above ask question, what I was doing wrong, was that we have to pass an argument of the ProfileField information we want, like this:

final Set<ProfileField> connectionFields = EnumSet.of(ProfileField.ID, ProfileField.MAIN_ADDRESS,
                ProfileField.PHONE_NUMBERS, ProfileField.LOCATION,
                ProfileField.LOCATION_COUNTRY, ProfileField.LOCATION_NAME,
                ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.HEADLINE,
                ProfileField.INDUSTRY, ProfileField.CURRENT_STATUS,
                ProfileField.CURRENT_STATUS_TIMESTAMP, ProfileField.API_STANDARD_PROFILE_REQUEST,
                ProfileField.EDUCATIONS, ProfileField.PUBLIC_PROFILE_URL, ProfileField.POSITIONS,
                ProfileField.LOCATION, ProfileField.PICTURE_URL);
        Connections connections = client.getConnectionsForCurrentUser(connectionFields);
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
Animesh Sinha
  • 1,045
  • 9
  • 16
  • 2
    I m using the shown snippet, but unable to get connection due to permission error in auth token – Arpit Garg Sep 28 '12 at 12:23
  • so what i have to do for get email address?? – duggu Jun 19 '13 at 03:40
  • @Animesh Sinha, I ab able to get my all connections using getConnectionsForCurrentUser() method but don't how to get connections in batching. I tried getConnectionsForCurrentUser(arg0, arg1) method to get connections in batching but couldn't get proper data( some connections are skipped, repeated). I am assuming param 'arg0' as START and 'arg1' as END. Suggest me if i am wrong. – Hiren Dabhi Jun 16 '16 at 07:12