In this tutorial, we will integrate the LinkedIn Sign-In functionality in our Android application. Implementing LinkedIn API in Android app helps users to login using LinkedIn account, share post, etc.
The LinkedIn Job Search app is going away in May. We know this is a change, but not to worry. All your Job Search app features and saved preferences are available in the main LinkedIn app: search millions of jobs, find improved job search filters, easily apply, let recruiters quietly know you’re looking. Make the most of LinkedIn with our suite of mobile apps. We'll help you search for jobs, get your daily professional news, build your skills and much more. Learn how to build a simple application with Kotlin and make it your language of choice. Download courses using your iOS or Android LinkedIn.
For integrating the LinkedIn API in our Android app, we need the LinkedIn Authentication Key (Client ID and Client Secret) and app Hash Key.
Steps to generate LinkedIn Authentication Key and APP Hash Key
1. Create LinkedIn developer account at https://www.linkedin.com/developer/apps and click on 'Create Application'.
2. Fill all the required details of Android application in 'Create a New Application' form and accept the LinkedIn API Terms of Use then click 'Submit'.
3. After submitting the application details, it generates LinkedIn Authentication Key. Now we will select the 'Default Application Permissions'. This permission authorizes to access privilege of user account. Here, we are selecting r_basicprofile, and 'r_emailaddress' and click 'Update'.
4. Now, we need the 'Hash Key' for our app. It can be generated by two different ways.
Using command on command prompt.
Windows:
Mac/Unix
To generate the Hash Key through command prompt, it requires OpenSSL to be installed in our operating system. We can download it for Windows from www.slproweb.com/products/Win32OpenSSL.html and for Mac/Unix from http://www.openssl.org/source/ .
Using the programming code in Activity.java class.
For this application, we will use the programming code to generate 'Hash Key' for our application.
Now create our application and simply write the following code and run to generate our 'Hash Key'. It will show the application 'Hash Key' in Logcat.
MainActivity.java
Download Linkedin Application For Android Free
5. Copy the 'Hash Key' from Logcat and paste it in Mobile tab of our LinkedIn application. After that click on 'Add' and 'Update'. This makes our application 'Hash Key' registered with LinkedIn API.
Example to Integrate LinkedIn Login in Android app
Let's create an example of integrating the LinkedIn log-in functionality in our Android application. After successful user log-in, it will redirect user to another activity (ProfileActivity) and display the user information.
We need to add the LinkedIn SDK for Android in our project. It can be downloaded from here https://developer.linkedin.com/downloads#androidsdk.
Required Permission
Add the Internet permission in AndroidMenifest.xml file.
Add the compile project(path: ':linkedin-sdk') in build.gradle file.
activity_main.xml
Add the following code in activity_main.xml file. Download the recommended LinkedIn button from LinkedIn developer site https://developer.linkedin.com/downloads and add it as the background of button.
Download Linkedin Application For Android Phones
MainActivity.java
In the MainActivity.java class, we use the LISessionManager class which provides all functionality to create and manage the LISession object (LinkedIn session object). In the build, scope adds the 'Scope.R_BASICPROFILE' and 'Scope.R_EMAILADDRESS' to access user basic profile information and email address of LinkedIn.
This Meme generator is packed with over 500 incredible memes with example captions and other cool features that will make you become meme addicted!Meme Generator Free is extremely simple to use: start by choosing one of the available memes or add your own pictures from your gallery or camera; next, select an example caption or create your own; and finally, share them with your friends and family using Facebook, Instagram, Gmail, Google+, Messenger and more! Plus, all of your custom-pictures will be saved locally so that you can use them later!Other incredible features include the ability to: select picture quality; change text size, colour and font; add cool stickers to your memes; add black borders; crop pictures; combine multiple pictures into one multi-panel meme, and so much more!This app is perfect for Instagram!The best part is that no Internet connection is required.Download Meme Generator now and have fun creating awesome memes! Description of Meme Generator FreeMeme Generator Free is an amazing app that allows you to create funny, custom-made memes. Meme generator app for windows.
activity_profile.xml
Now, add the following code in activity_profile.xml file. In this activity, we will display the user information after successful login.
Download Applications For Android Phones
ProfileActivity.java
Linkedin For Android
Add the LinkedIn API URL https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address) in getRequest() method of APIHelper class. It will retrieve the user information on success of LinkedIn API.