Latest technology news, trends and developers guide for business application. Visit this space for more tech updates.

Let’s work on your exciting new project together!

Step by Step Developers Guide to Integrate LinkedIn with an Android Application

Android App Development, Tech Blog, Tech Trends

LinkedIn is the most popular professional networking platform on which users can share updates about their professional lives including projects completed, milestones achieved and make new professional connections. It presents formal curriculum vitae of the individual which can be browsed by recruiters.

Overview of SDK

  • The mobile SDK for Android reduces your app’s time to market by providing out-of-box support for LinkedIn natively inside your Android applications.
  • The Mobile SDK for Android requires the official LinkedIn Android application is also installed to support the SDK’s capabilities.
  • The minimum supported version is Android 4.4.2 (API 19).

SDK Features

-Single sign-on (SSO) authentication, in conjunction with the LinkedIn mobile app.

-A convenient wrapper for making authenticated calls to LinkedIn’s REST APIs.

-“Deep linking” to additional member data in the LinkedIn mobile app.

-Sample application that demonstrates best-practice implementations of all of the SDK’s features.

Please find steps below for LinkedIn integration in Android.

Step 1- Create Application

-To Integrate LinkedIn in your mobile application, you need to create a new application using LinkedIn Developer’s Account

-Create application from LinkedIn developer account

Step 2- Set the Application Permission

You have to set the Default Application Permissions and to do that you have to select check box “r_basicprofile” and “r_emailaddress” and click on the “update” button to set the permission.

Step 3- Download Mobile LinkedIn SDK

Go to and download a Mobile SDK for Android

Step 4- Generate Hash Key

-Generate a hash key and integrate your app with LinkedIn account

-Go to

-Select your application name and click the Mobile tab

-Add the package name and generated hash key in your LinkedIn Application.

-This hash key will authenticate your mobile application.


private static final String topCardUrl = "https://" + host + "/v1/people/~:(first-name,last-name,email-address,formatted-name,phone-numbers,public-profile-url,picture-url,picture-urls::(original))";
private static Scope buildScope() {
return, Scope.R_EMAILADDRESS, Scope.W_SHARE);
public void loginLinkedin() {
buildScope(), new AuthListener() {
public void onAuthSuccess() {

APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.getRequest(MainActivity.this, topCardUrl, new ApiListener() {
public void onApiSuccess(ApiResponse s) {


public void onApiError(LIApiError error) {


public void onAuthError(LIAuthError error) {

}, true);


Check Login
private boolean isLogin(){
LISessionManager sessionManager = LISessionManager.getInstance(getApplicationContext());
LISession session = sessionManager.getSession();
boolean accessTokenValid = session.isValid();
return accessTokenValid;
Share Message
private static final String shareUrl = "https://" + host + "/v1/people/~/shares";

public void shareMessage() {
APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.postRequest(MainActivity.this, shareUrl, buildShareMessage("Hello World", "Hello Title", "Hello Descriptions", "", ""), new ApiListener() {
public void onApiSuccess(ApiResponse apiResponse) {


public void onApiError(LIApiError error) {

public String buildShareMessage(String comment,String title,String descriptions,String linkUrl,String imageUrl ){
String shareJsonText = "{ \n" +
" \"comment\":\"" + comment + "\"," +
" \"visibility\":{ " +
" \"code\":\"anyone\"" +
" }," +
" \"content\":{ " +
" \"title\":\""+title+"\"," +
" \"description\":\""+descriptions+"\"," +
" \"submitted-url\":\""+linkUrl+"\"," +
" \"submitted-image-url\":\""+imageUrl+"\"" +
" }" +
return shareJsonText;

Open Current User Profile

public void openUserProfile(){
DeepLinkHelper deepLinkHelper = DeepLinkHelper.getInstance();
deepLinkHelper.openCurrentProfile(MainActivity.this, new DeepLinkListener() {
public void onDeepLinkSuccess() {

public void onDeepLinkError(LIDeepLinkError error) {

Best Practices

Posting on member’s behalf :You should assure users that you will not post or send mail on their behalf without their consent, and give them the option to edit content before it is posted or not share content if they choose.

Permission Request:You should educate users on which permissions you are requesting and how this data will be used. LinkedIn does not support incremental permission request, so all permissions must be granted during the authorization step.


  • Remind the user that they are logged into your application by displaying their name, portrait, and/or account settings.
  • Avoid multiple log-in prompts
  • Cache the user’s access token after they grant your application and do not bring the user through the authentication flow again unless they log out or the access token expires or is otherwise invalid.
  • You should allow the user to log out, and when they do log out you should destroy the access token you had been granted.

Canceling in-progress requests: During your application’s workflow, you may wish to cancel any in-progress API requests. This is done by calling APIHelper.cancelCalls() method.

Using ProGaurd with your application: If you intend to use ProGuard on the release build of your mobile application, you will need to add the following lines to your project’s proguard-project.txt file to preserve information required for the SDK to function properly:

Proguard configuration- Keep class com.linkedin.** { *; } , keepattributes Signature

Mobile access tokens

It is important to note that access tokens that are acquired via the Mobile SDK are only useable with the Mobile SDK, and cannot be used to make server-side REST API calls.

Partnership Program

All other APIs (e.g. Connections, Groups, People Search, Invitation, Job Search, etc.) will require developers to become a member of one of our partnership programs.

Partnering with LinkedIn provides you with additional API functionality & data access, increased call limits & dedicated support.

Applications are only accepted when we feel that they’re providing value to members, developers, and LinkedIn.


You can Download source code of this example from Github.

Why You Should Treat Your Business App as Product, Not Project

How do you treat your business app- as a project or a product? You may...

Top IoT App Development Trends that are Set to Rule Mobile Platform in 2019

IoT is in vogue. However, the term Internet of Things was coined in the late...

Six Futuristic Trends to Watch for iOS Application Development

With the advent of iOS 12, the Cupertino Company Apple has made one thing clear...

Subscribe to our Newsletter Receive free e-guides, news, updates and more