Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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. Open the SampleApps/MyNTORewards/connectedapp.properties.sample file and modify the properties of the connected app as per your org.
  7. Rename the connectedapp.properties.sample file to connectedapp.properties.
  8. Click Sync Now.
    Android Studio automatically downloads and manages external dependencies for the Mobile SDK and the Sample App.
  9. Open the SDK files and ensure that the files include the appropriate SDK packages.

    If the sync fails, disconnect the VPN to ensure there’s no blocker when downloading the dependencies, and then resync.

    Note

  10. 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.