Android SDK Setup

(Difference between revisions)
Jump to: navigation, search
(Download the SDK)
Line 1: Line 1:
= Download the SDK =
+
= Configure Social-ID SDK in your app =
 +
 
 +
You'll need 3 variables to configure the SDK:
 +
 
 +
* SENDER_ID: Set up a project on Google Developers Console - https://console.developers.google.com/project. Get your project number. This will be used as the SENDER_ID in the SDK.
 +
* LOGIN_APP_ID: Set up a Social-ID LoginApp at: https://app.socialidnow.com/marketing/login/apps. Your key is the id of the app. This will be used as the LOGIN_APP_ID in the SDK.
 +
* LOGIN_APP_CLIENT_SECRET: The client secret can be found on the Call the API menu - https://app.socialidnow.com/marketing/login/apps/APP_ID/apis. This will be used as the LOGIN_APP_CLIENT_SECRET in the SDK.
 +
 
 +
== Download the SDK ==  
  
 
[[Android_SDK_Download|Download the SDK]]
 
[[Android_SDK_Download|Download the SDK]]
Line 12: Line 20:
  
 
   dependencies {
 
   dependencies {
     compile project(':socialidsdk')
+
     implementation project(':socialidsdk')
 
   }
 
   }
  
= Get your Social-ID data =
+
== Android Manifest ==
  
You'll need 3 variables to configure the SDK:
+
Add the following definitions to AndroidManifest.xml immediately before opening the ''<application>'' tag:
  
* SENDER_ID: Set up a project on Google Developers Console - https://console.developers.google.com/project. Get your project number. This will be used as the SENDER_ID in the SDK.
+
  <uses-permission android:name="android.permission.INTERNET" />
* LOGIN_APP_ID: Set up a Social-ID LoginApp at: https://app.socialidnow.com/marketing/login/apps. Your key is the id of the app. This will be used as the LOGIN_APP_ID in the SDK.
+
  <uses-permission android:name="android.permission.USE_CREDENTIALS" />
* LOGIN_APP_CLIENT_SECRET: The client secret can be found on the Call the API menu - https://app.socialidnow.com/marketing/login/apps/APP_ID/apis. This will be used as the LOGIN_APP_CLIENT_SECRET in the SDK.
+
 
 +
  <nowiki><!-- BEGIN: use this if you need push notification support --></nowiki>
 +
  <uses-permission android:name="android.permission.WAKE_LOCK" />
 +
  <uses-permission android:name="android.permission.VIBRATE" />
 +
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 +
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
 +
  <uses-permission android:name="com.YOUR_PACKAGE.C2D_MESSAGE" />
 +
  <nowiki><!-- END: use this if you need push notification support --></nowiki>
 +
 
 +
Add the following definitions to AndroidManifest.xml inside the ''<application>'' tag:
 +
 
 +
  <nowiki><!-- BEGIN: use this if you need push notification support --></nowiki>
 +
  <receiver
 +
      android:name="com.coffeebeantech.socialidsdk.notification.NotificationReceiver"
 +
      android:permission="com.google.android.c2dm.permission.SEND" >
 +
      <intent-filter>
 +
          <action android:name="com.google.android.c2dm.intent.RECEIVE" />
 +
          <category android:name="com.YOUR_PACKAGE" />
 +
      </intent-filter>
 +
  </receiver>
 +
  <receiver
 +
      android:name="com.coffeebeantech.socialidsdk.registration.ConnectivityMonitor"
 +
      android:enabled="false" >
 +
      <intent-filter>
 +
          <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
 +
          <category android:name="com.YOUR_PACKAGE" />
 +
      </intent-filter>
 +
  </receiver>
 +
  <service android:name="com.coffeebeantech.socialidsdk.notification.NotificationService" />
 +
  <service android:name="com.coffeebeantech.socialidsdk.registration.RegistrationService" />
 +
  <nowiki><!-- END: use this if you need push notification support --></nowiki>
 +
 
 +
== Resources ==
 +
 
 +
Add the following variables to your resources file:
 +
 
 +
  <nowiki><!-- Social Id configuration --></nowiki>
 +
  <string name="login_app_id">LOGIN_APP_ID</string>;
 +
  <string name="login_app_client_secret">LOGIN_APP_CLIENT_SECRET</string>;
 +
 
 +
  <nowiki><!-- Google Project Number (if you need push notification support) --></nowiki>
 +
  <string name="sender_id">SENDER_ID</string>;
 +
 
 +
== Usage ==
 +
 
 +
Add the following import statements to your Activity:
 +
 
 +
  import com.coffeebeantech.socialidsdk.SocialId;
 +
  import com.coffeebeantech.socialidsdk.notification.NotificationParameters;
 +
 
 +
At your Activity onCreate method, call SocialId.configLoginProviders with the desired providers configuration and then call SocialId.config to set your Social-ID configuration using the resources set before:
 +
 
 +
  // pass the providers configuration that will be set
 +
  SocialId.configLoginProviders(facebookConfiguration, gplusConfiguration, linkedinConfiguration, twitterConfiguration, emailConfiguration);
 +
 
 +
  // with push notifications support
 +
  SocialId.config(this, "SENDER_ID", "LOGIN_APP_ID", "LOGIN_APP_CLIENT_SECRET");
 +
  // without push notifications support
 +
  SocialId.config(this, "LOGIN_APP_ID", "LOGIN_APP_CLIENT_SECRET");
 +
 
 +
= Add Facebook Login to your app =
 +
 
 +
Before start adding the Facebook SDK, you must allow your Facebook App to receive requests from your Android project.
  
= Add Facebook SDK to your app =
+
* At the Facebook for developers page, find your Facebook App at [https://developers.facebook.com/apps/ My Apps]
 +
* Go to Settings > Basic
 +
* At the end of page click on "Add a Platform" and then select "Android"
 +
* Add your project package name at "Google Play Package Name" and your default activity class name at "Class Name"
 +
* Export your Development Key Hash using the instructions for your operating system, add the exported key to "Key Hashes" and then "Save Changes" to proceed to next steps
 +
: MacOS
 +
  $ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
 +
: Windows
 +
: You need the folowing:
 +
:* Key and Certificate Management Tool ('''keytool''') from the Java Development Kit
 +
:* [https://code.google.com/archive/p/openssl-for-windows/downloads openssl-for-windows] openssl library for Windows from the Google Code Archive
 +
  $ keytool -exportcert -alias androiddebugkey -keystore "C:\Users\USERNAME\.android\debug.keystore" | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" sha1 -binary | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" base64
  
 
Add the Facebook maven repository to your ''app/build.gradle'' before the ''dependencies'' area and add the latest Facebook SDK dependency to your list of dependencies:
 
Add the Facebook maven repository to your ''app/build.gradle'' before the ''dependencies'' area and add the latest Facebook SDK dependency to your list of dependencies:
Line 32: Line 113:
 
    
 
    
 
   dependencies {  
 
   dependencies {  
     compile 'com.facebook.android:facebook-android-sdk:4.7.0'
+
     implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
 
   }
 
   }
  
= Add Twitter Fabric SDK to your app =
+
== Android Manifest ==
  
You can find Fabric installation steps in their official page: [https://get.fabric.io/android].
+
Add the Facebook ApplicationId that will be used in your AndroidManifest.xml inside the <application> tag as following:
  
After adding the Fabric plugin to AndroidStudio, add the following configurations to your ''app/build.gradle'' file (or follow Fabric's setup guide):
+
  <meta-data
 +
    android:name="com.facebook.sdk.ApplicationId"
 +
    android:value="@string/facebook_app_id" />
 +
 
 +
  <nowiki><!-- If you want to make changes to the Facebook Login Activity you can do changes using de tag below --></nowiki>
 +
  <activity android:name="com.facebook.FacebookActivity"
 +
    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
 +
    android:label="@string/app_name" />
 +
  </activity>
  
  buildscript {
+
== Resources ==
    repositories {
+
 
      maven { url 'https://maven.fabric.io/public' }
+
Add the following variables to your resources file:
    }
+
 
    
+
   <!-- Facebook App ID -->
    dependencies {
+
   <string name="facebook_app_id">FACEBOOK_APP_ID</string>
      classpath 'io.fabric.tools:gradle:1.+'
+
    }
+
   }
+
 
+
  apply plugin: 'io.fabric'
+
 
    
 
    
 +
  <string-array name="facebook_permissions">
 +
      <item>public_profile</item>
 +
      <item>user_birthday</item>
 +
      <item>email</item>
 +
      <item>user_location</item>
 +
  </string-array>
 +
 +
== Usage ==
 +
 +
Initializes a new Facebook configuration and set the permissions:
 +
 +
  // Facebook configuration
 +
  FacebookConfiguration facebookConfiguration = new FacebookConfiguration()
 +
      .setPermissions("FACEBOOK_PERMISSIONS");
 +
 +
= Add Twitter Login to your app =
 +
 +
Add the '''twittersdk://''' to your [https://developer.twitter.com/en/apps Twitter App] Callback URLs to allow an Android project to use it.
 +
 +
Add the Twitter JCenter repository to your app/build.gradle before the dependencies area and add the Twitter SDK dependency to your list of dependencies:
 +
 
   repositories {
 
   repositories {
     maven { url 'https://maven.fabric.io/public' }
+
     jcenter()
 
   }
 
   }
 
    
 
    
 
   dependencies {
 
   dependencies {
     compile('com.twitter.sdk.android:twitter:1.8.0@aar') {
+
     implementation('com.twitter.sdk.android:twitter:3.1.1') {
 
       transitive = true;
 
       transitive = true;
 
     }
 
     }
 
   }
 
   }
  
= Configure Social-ID SDK in your app =
+
== Resources ==
  
Add the following import statements to your Activity:
+
  <!-- Twitter Credentials -->
 +
  <string name="twitter_key">TWITTER_KEY</string>
 +
  <string name="twitter_secret">TWITTER_SECRET</string>
  
  import com.coffeebeantech.socialidsdk.SocialId;
+
== Usage ==
  import com.coffeebeantech.socialidsdk.notification.NotificationParameters;
+
  
Call SocialId.config from the onCreate method of your Activity class to set your application Social-ID configuration:
+
Initializes a new Twitter configuration and set the credentials:
  
   //with push notifications support
+
   // Twitter configuration
   SocialId.config(this, "SENDER_ID", "LOGIN_APP_ID", "LOGIN_APP_CLIENT_SECRET");
+
   TwitterConfiguration twitterConfiguration = new TwitterConfiguration()
  //without push notifications support
+
      .setTwitterKey("TWITTER_KEY")
  SocialId.config(this, "LOGIN_APP_ID", "LOGIN_APP_CLIENT_SECRET");
+
      .setTwitterSecret("TWITTER_SECRET");
  
Add the following variable to the ''res/values/strings.xml'' file:
 
  <!-- Facebook App ID -->
 
  <string name="app_id">FACEBOOK_APP_ID</string>
 
  
Add the following content to the ''assets/oauth_consumer.properties'' file. Ensure the ''assets'' folder is at the same level as the ''res'' folder.
+
= Add Google Login to your app =
 +
 
 +
To add the Google Login to your Android project you must:
 +
 
 +
* Have an Android and a Web Application "OAuth client ID" [https://console.developers.google.com/apis/credentials Credentials]
 +
** The Android Credential must be set with the SHA1 signing-certificate fingerprint and the Package Name to the Login with Google work.
 +
 
 +
Example to export the SHA1 from the debug key:
 +
  $ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v
 +
 
 +
 
 +
Add the latest Google GCM and Auth SDK dependency to your list of dependencies:
 +
 
 +
  dependencies {
 +
    implementation 'com.google.android.gms:play-services-gcm:16.0.0'
 +
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
 +
  }
 +
 
 +
== Resources ==
 +
 
 +
Add the Client ID from the created Web Application credential  to your resources file:
 +
  <nowiki><!-- Google Client Server ID --></nowiki>
 +
  <string name="google_client_server_id">"WEB_APPLICATION_CLIENT_ID"</string>;
 +
 
 +
== Usage ==
 +
 
 +
Initializes a new Gplus configuration and set the client server id with the Web Application client ID:
 +
  // Google+ configuration
 +
  GplusConfiguration gplusConfiguration = new GplusConfiguration()
 +
      .setClientServerId("WEB_APPLICATION_CLIENT_ID"));
 +
 
 +
= Add Linkedin Login to your app =
 +
 
 +
Add the following content to the ''assets/oauth_consumer.properties'' file. Custom Permissions must be a single string split by a comma (ex: r_liteprofile,r_emailaddress). Ensure the ''assets'' folder is at the same level as the ''res'' folder.
 
   #linkedin
 
   #linkedin
 
   api.linkedin.com.consumer_key = LINKEDIN_CLIENT_ID
 
   api.linkedin.com.consumer_key = LINKEDIN_CLIENT_ID
 
   api.linkedin.com.consumer_secret = LINKEDIN_CLIENT_SECRET
 
   api.linkedin.com.consumer_secret = LINKEDIN_CLIENT_SECRET
 +
  api.linkedin.com.custom_permissions = LINKEDIN_PERMISSIONS
  
= Modify app manifest =
+
== Resources ==
  
Add the following definitions to AndroidManifest.xml immediately before opening the ''<application>'' tag:
+
Add the Linkedin Callback URI to your resources file:
  
  <uses-permission android:name="android.permission.INTERNET" />
+
   <nowiki><!-- Linkedin Callback URI --></nowiki>
  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
+
   <string name="linkedin_callback_uri">LINKDEIN_CALLBACK_URI</string>
  <uses-permission android:name="android.permission.USE_CREDENTIALS" />
+
 
+
   <nowiki><!-- BEGIN: use this if you need push notification support --></nowiki>
+
   <uses-permission android:name="android.permission.WAKE_LOCK" />
+
  <uses-permission android:name="android.permission.VIBRATE" />
+
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
+
  <permission
+
      android:name="com.YOUR_PACKAGE.C2D_MESSAGE"
+
      android:protectionLevel="signature" />   
+
  <uses-permission android:name="com.YOUR_PACKAGE.C2D_MESSAGE" />
+
  <nowiki><!-- END: use this if you need push notification support --></nowiki>
+
  
Add the following definitions to AndroidManifest.xml inside the ''<application>'' tag:
+
== Usage ==
  
  <meta-data
+
Initializes a new Linkedin configuration and set the callback uri:
      android:name="com.google.android.gms.version"
+
 
      android:value="@integer/google_play_services_version" />
+
   // LinkedIn configuration
   <meta-data
+
   LinkedinConfiguration linkedinConfiguration = new LinkedinConfiguration()
      android:name="com.facebook.sdk.ApplicationId"
+
       .setCallbackUri(getString("LINKDEIN_CALLBACK_URI");
      android:value="@string/app_id" />
+
   <meta-data
+
      android:name="io.fabric.ApiKey"
+
       android:value="FABRIC_API_KEY" />
+
 
+
  <activity android:name="com.facebook.FacebookActivity"
+
      android:theme="@android:style/Theme.Translucent.NoTitleBar"
+
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+
      android:label="@string/app_name" />
+
  </activity>
+
 
+
  <nowiki><!-- BEGIN: use this if you need push notification support --></nowiki>
+
  <receiver
+
      android:name="com.coffeebeantech.socialidsdk.notification.NotificationReceiver"
+
      android:permission="com.google.android.c2dm.permission.SEND" >
+
      <intent-filter>
+
          <action android:name="com.google.android.c2dm.intent.RECEIVE" />
+
          <category android:name="com.YOUR_PACKAGE" />
+
      </intent-filter>
+
  </receiver>
+
  <receiver
+
      android:name="com.coffeebeantech.socialidsdk.registration.ConnectivityMonitor"
+
      android:enabled="false" >
+
      <intent-filter>
+
          <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
+
          <category android:name="com.YOUR_PACKAGE" />
+
      </intent-filter>
+
  </receiver>
+
  <service android:name="com.coffeebeantech.socialidsdk.notification.NotificationService" />
+
  <service android:name="com.coffeebeantech.socialidsdk.registration.RegistrationService" />
+
  <nowiki><!-- END: use this if you need push notification support --></nowiki>
+

Revision as of 22:02, 24 February 2019

Contents

Configure Social-ID SDK in your app

You'll need 3 variables to configure the SDK:

Download the SDK

Download the SDK

Import the AAR file into your existing AndroidStudio as a new module and update your project and app .gradle files to include the new module.

Project settings.gradle file:

 include ':socialidsdk'

App specific app/build.gradle file:

 dependencies {
   implementation project(':socialidsdk')
 }

Android Manifest

Add the following definitions to AndroidManifest.xml immediately before opening the <application> tag:

 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.USE_CREDENTIALS" />
 
 <!-- BEGIN: use this if you need push notification support -->
 <uses-permission android:name="android.permission.WAKE_LOCK" />
 <uses-permission android:name="android.permission.VIBRATE" />
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
 <uses-permission android:name="com.YOUR_PACKAGE.C2D_MESSAGE" />
 <!-- END: use this if you need push notification support -->

Add the following definitions to AndroidManifest.xml inside the <application> tag:

 <!-- BEGIN: use this if you need push notification support -->
 <receiver
     android:name="com.coffeebeantech.socialidsdk.notification.NotificationReceiver"
     android:permission="com.google.android.c2dm.permission.SEND" >
     <intent-filter>
         <action android:name="com.google.android.c2dm.intent.RECEIVE" />
         <category android:name="com.YOUR_PACKAGE" />
     </intent-filter>
 </receiver>
 <receiver
     android:name="com.coffeebeantech.socialidsdk.registration.ConnectivityMonitor"
     android:enabled="false" >
     <intent-filter>
         <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
         <category android:name="com.YOUR_PACKAGE" />
     </intent-filter>
 </receiver>
 <service android:name="com.coffeebeantech.socialidsdk.notification.NotificationService" />
 <service android:name="com.coffeebeantech.socialidsdk.registration.RegistrationService" />
 <!-- END: use this if you need push notification support -->

Resources

Add the following variables to your resources file:

 <!-- Social Id configuration -->
 <string name="login_app_id">LOGIN_APP_ID</string>;
 <string name="login_app_client_secret">LOGIN_APP_CLIENT_SECRET</string>;
 
 <!-- Google Project Number (if you need push notification support) -->
 <string name="sender_id">SENDER_ID</string>;

Usage

Add the following import statements to your Activity:

 import com.coffeebeantech.socialidsdk.SocialId;
 import com.coffeebeantech.socialidsdk.notification.NotificationParameters;

At your Activity onCreate method, call SocialId.configLoginProviders with the desired providers configuration and then call SocialId.config to set your Social-ID configuration using the resources set before:

 // pass the providers configuration that will be set
 SocialId.configLoginProviders(facebookConfiguration, gplusConfiguration, linkedinConfiguration, twitterConfiguration, emailConfiguration);
 
 // with push notifications support
 SocialId.config(this, "SENDER_ID", "LOGIN_APP_ID", "LOGIN_APP_CLIENT_SECRET");
 // without push notifications support
 SocialId.config(this, "LOGIN_APP_ID", "LOGIN_APP_CLIENT_SECRET");

Add Facebook Login to your app

Before start adding the Facebook SDK, you must allow your Facebook App to receive requests from your Android project.

  • At the Facebook for developers page, find your Facebook App at My Apps
  • Go to Settings > Basic
  • At the end of page click on "Add a Platform" and then select "Android"
  • Add your project package name at "Google Play Package Name" and your default activity class name at "Class Name"
  • Export your Development Key Hash using the instructions for your operating system, add the exported key to "Key Hashes" and then "Save Changes" to proceed to next steps
MacOS
 $ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 
Windows
You need the folowing:
  • Key and Certificate Management Tool (keytool) from the Java Development Kit
  • openssl-for-windows openssl library for Windows from the Google Code Archive
 $ keytool -exportcert -alias androiddebugkey -keystore "C:\Users\USERNAME\.android\debug.keystore" | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" sha1 -binary | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" base64

Add the Facebook maven repository to your app/build.gradle before the dependencies area and add the latest Facebook SDK dependency to your list of dependencies:

 repositories {
   mavenCentral() 
 }
 
 dependencies { 
   implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
 }

Android Manifest

Add the Facebook ApplicationId that will be used in your AndroidManifest.xml inside the <application> tag as following:

 <meta-data
    android:name="com.facebook.sdk.ApplicationId"
    android:value="@string/facebook_app_id" />
 
 <!-- If you want to make changes to the Facebook Login Activity you can do changes using de tag below -->
 <activity android:name="com.facebook.FacebookActivity"
    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    android:label="@string/app_name" />
 </activity>

Resources

Add the following variables to your resources file:

 <string name="facebook_app_id">FACEBOOK_APP_ID</string>
 
 <string-array name="facebook_permissions">
     <item>public_profile</item>
     <item>user_birthday</item>
     <item>email</item>
     <item>user_location</item>
 </string-array>

Usage

Initializes a new Facebook configuration and set the permissions:

 // Facebook configuration
 FacebookConfiguration facebookConfiguration = new FacebookConfiguration()
     .setPermissions("FACEBOOK_PERMISSIONS");

Add Twitter Login to your app

Add the twittersdk:// to your Twitter App Callback URLs to allow an Android project to use it.

Add the Twitter JCenter repository to your app/build.gradle before the dependencies area and add the Twitter SDK dependency to your list of dependencies:

 repositories {
   jcenter()
 }
 
 dependencies {
   implementation('com.twitter.sdk.android:twitter:3.1.1') {
     transitive = true;
   }
 }

Resources

 <string name="twitter_key">TWITTER_KEY</string>
 <string name="twitter_secret">TWITTER_SECRET</string>

Usage

Initializes a new Twitter configuration and set the credentials:

 // Twitter configuration
 TwitterConfiguration twitterConfiguration = new TwitterConfiguration()
     .setTwitterKey("TWITTER_KEY")
     .setTwitterSecret("TWITTER_SECRET");


Add Google Login to your app

To add the Google Login to your Android project you must:

  • Have an Android and a Web Application "OAuth client ID" Credentials
    • The Android Credential must be set with the SHA1 signing-certificate fingerprint and the Package Name to the Login with Google work.

Example to export the SHA1 from the debug key:

 $ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v


Add the latest Google GCM and Auth SDK dependency to your list of dependencies:

 dependencies {
   implementation 'com.google.android.gms:play-services-gcm:16.0.0'
   implementation 'com.google.android.gms:play-services-auth:16.0.1'
 }

Resources

Add the Client ID from the created Web Application credential to your resources file:

 <!-- Google Client Server ID -->
 <string name="google_client_server_id">"WEB_APPLICATION_CLIENT_ID"</string>; 

Usage

Initializes a new Gplus configuration and set the client server id with the Web Application client ID:

 // Google+ configuration
 GplusConfiguration gplusConfiguration = new GplusConfiguration()
     .setClientServerId("WEB_APPLICATION_CLIENT_ID"));

Add Linkedin Login to your app

Add the following content to the assets/oauth_consumer.properties file. Custom Permissions must be a single string split by a comma (ex: r_liteprofile,r_emailaddress). Ensure the assets folder is at the same level as the res folder.

 #linkedin
 api.linkedin.com.consumer_key = LINKEDIN_CLIENT_ID
 api.linkedin.com.consumer_secret = LINKEDIN_CLIENT_SECRET
 api.linkedin.com.custom_permissions = LINKEDIN_PERMISSIONS 

Resources

Add the Linkedin Callback URI to your resources file:

 <!-- Linkedin Callback URI -->
 <string name="linkedin_callback_uri">LINKDEIN_CALLBACK_URI</string>

Usage

Initializes a new Linkedin configuration and set the callback uri:

 // LinkedIn configuration
 LinkedinConfiguration linkedinConfiguration = new LinkedinConfiguration()
     .setCallbackUri(getString("LINKDEIN_CALLBACK_URI");
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox