Newer Version Available

This content describes an older version of this product. View Latest

Import SDK into Android Studio

After you clone the mobile SDK for Android repository, import Loyalty Management Mobile SDK in Android Studio to automatically download and manage external dependencies.
Available in: all editions that have Loyalty Management enabled

  1. Unzip the LoyaltyMobileSDK-Android package that you downloaded.
  2. Open Android Studio.
  3. Go to File | New | Import Project, and then select the LoyaltyMobileSDK-Android folder.
  4. Click Open.
  5. Open the SampleApps/MyNTORewards/build.gradle file and under Dependencies block, to the first line of Dependencies, add:
    {implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(path: ':Sources') }
  6. Click Sync Now.
    Android Studio automatically downloads and manages external dependencies for the Mobile SDK and the Sample App.
  7. Open the SDK files and ensure that the files include the appropriate SDK packages.
  8. Add the code snippet to add the appropriate SDK package:
    import com.salesforce.loyalty.mobile.sources.forceUtils.* import com.salesforce.loyalty.mobile.sources.loyaltyAPI.* import com.salesforce.loyalty.mobile.sources.loyaltyModels.* import com.salesforce.loyalty.mobile.sources.loyaltyExtensions.*
You can now use the classes and structures in the LoyaltyMobileSDK-Android module and API references to manage the features in your application.