Adding the MobileFirst Foundation SDK to Cordova Applications.
In this tutorial, you learn how to add the MobileFirst SDK to a new or existing Cordova application that has been created with Apache
Cordova, Ionic, or another thirdy-party tool. You also learn how to configure the MobileFirst Server to recognize the application, and
to find information about the MobileFirst configuration files that are changed in the project.
The MobileFirst Cordova SDK is provided as a set of Cordova plug-ins, and is registered at NPM.
Available plug-ins are:
- cordova-plugin-mfp - The core SDK plug-in
- cordova-plugin-mfp-push - Provides push notifications support
- cordova-plugin-mfp-jsonstore - Provides JSONStore support
- cordova-plugin-mfp-fips - Android only. Provides FIPS support
- cordova-plugin-mfp-encrypt-utils - iOS only. Provides support for encryption and decryption
The Cordova platform versions supported by the MobileFirst plug-ins, are:
- cordova-ios: >= 4.1.1 and < 5.0
- cordova-android: >= 6.1.2 and <= 7.0
- cordova-windows: >= 4.3.2 and < 6.0
Before creating new application or using existing one, we need to install related software.
- Node.js
- NPM(3.10.10) -
npm install -g npm@3.10.10
- Codova -
npm install -g cordova
- **JDK 7 or 8 **
- MobileFirst CLI -
npm install -g mfpdev-cli
- MobileFirst Server
- Gradle - Extract and add path in System variable
- Android Studio & SDK
git clone https://github.com/progaurab/Exe01_StarterCordovaMobileFirst.git
and then follow from step 4.
Consider creating the project by using the MobileFirst Cordova application template. The template adds the necessary MobileFirst-
specific plug-in entries to the Cordova project’s config.xml file, and provides a MobileFirst-specific, ready-to-use, index.js file
that is adjusted for MobileFirst application development.
cordova create Exe01_StarterCordovaMobileFirst com.androidabcd.helloworld HelloWorld --template cordova-template-mfp
Where,
- “Exe01_StarterCordovaMobileFirst” is the folder name of the application.
- “com.androidabcd.helloworld” is the ID of the application.
- “HelloWorld” is the Name of the application.
- –template modifies the application with MobileFirst-specific additions.
cd Exe01_StarterCordovaMobileFirst
cordova platform add android
and then follow from step 6.
Step 5: Navigate to the root of your existing Cordova project and add the MobileFirst core Cordova plug-in:
cordova plugin add cordova-plugin-mfp
cordova prepare
-
From a Command-line window, navigate to the extracted folder and execute the run.sh|cmd script to start the MobileFirst Server.
-
Load the MobileFirst Operations Console (username/password: admin/admin):
http://localhost:9080/mfpconsole
mfpdev app register
cordova buld android
cordova run android