You can add more MobileFirst features
to your Android application with Gradle.
About this task
To add additional features, add the optional
aar files
to your Android Studio project. Some additional steps for setting
up Android Studio to support your feature may exist.
These are the
optional aar files:
Table 1. Android
SDK| aar |
feature |
| ibmmobilefirstplatformfoundationpush.aar |
Push notifications. For more information on setup see Setting up push notifications. |
| ibmmobilefirstplatformfoundationjsonstore.aar |
JSONStore. For more information on setup see JSONStore. |
Procedure
- For each aar to be added, add entries
to the build.gradle file.
- For accessing and installing aar remotely,
add a compile entry to the dependencies enclosure
in the app\build.gradle file. There should be
an existing compile entry for the main MobileFirst aar file.
dependencies {
compile 'com.ibm.mobile.foundation:ibmmobilefirstplatformfoundation:8.0.+'
compile 'com.ibm.mobile.foundation:ibmmobilefirstplatformfoundationpush:8.0.+'
compile 'com.ibm.mobile.foundation:ibmmobilefirstplatformfoundationjsonstore:8.0.+'
}
Note: In this example the latest version of
8.0 is
imported. If you want to import a specific version such as
8.0.2016021411,
replace with the
MobileFirst version
number you are using, including the major, minor, and patch numbers.
The patch number is in the format
YYYYMMDDHH. For example:
compile 'com.ibm.mobile.foundation:ibmmobilefirstplatformfoundation:8.0.2016021411'
- For installing locally available aar files,
copy the optional aar file to the libs folder.
Add a line to the dependency enclosure for each aar file
needed. This example adds all the optional and required SDKs.
dependencies {
compile(name:'ibmmobilefirstplatformfoundation', ext:'aar')
compile(name:'ibmmobilefirstplatformfoundationjsonstore', ext:'aar')
compile(name:'ibmmobilefirstplatformfoundationpush', ext:'aar')
}
- Rebuild your application.
- The imported SDK includes the Javadocs but they need to
be linked in your Android Studio project. For details see Registering Javadocs to an Android Studio Gradle project.
Results
You can now start developing your native
IBM MobileFirst™ Platform Foundation Android
app with additional features.