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 |
- Unzip the LoyaltyMobileSDK-Android package that you downloaded.
- Open Android Studio.
- Go to , and then select the LoyaltyMobileSDK-Android folder.
- Click Open.
-
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') }
- Open the SampleApps/MyNTORewards/connectedapp.properties.sample file and modify the properties of the connected app as per your org.
- Rename the connectedapp.properties.sample file to connectedapp.properties.
-
Click Sync Now.
Android Studio automatically downloads and manages external dependencies for the Mobile SDK and the Sample App.
-
Open the SDK files and ensure that the files include the appropriate SDK
packages.
-
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.