Course materials may not be reproduced in whole or in part without the prior written permission of IBM. Unit objectives • Install the MobileFirst Platform Foundation Developer Kit • Set up the MobileFirst Development Server • Install the MobileFirst Platform CLI • Set up the platform-specific IDE and tools
Overview • Depending on the type of applications that you want to create, you might need to install these tools on your development workstation: ▪ Java: Required by MobileFirst Server and Maven ▪ MobileFirst Development Kit ▪ Bluemix account: Required for running MobileFirst Foundation Service ▪ Node.js: Required by MobileFirst CLI ▪ MobileFirst CLI ▪ Cordova CLI ▪ An IDE for your platform: Xcode, Android Studio, Visual Studio, and others ▪ Apache Maven: Required for developing MobileFirst adapters ▪ Eclipse: Required for developing MobileFirst adapters and working with Cordova and hybrid applications ▪ MobileFirst Studio and THyM plug-ins
MobileFirst Foundation Development Kit • Provides a ready-for-development environment with minimal configuration needed • Includes the following components: ▪ MobileFirst Server ▪ MobileFirst Operations Console ▪ MobileFirst Developer Command-Line Interface (CLI) ▪ MobileFirst client SDKs ▪ MobileFirst adapter tools • Available from https://mobilefirstplatform.ibmcloud.com/downloads/ ▪ Requires Java 7 or 8 ▪ Set the JAVA_HOME environment variable to your JDK directory ▪ Download the installer for your platform ▪ After installation completes: 1. Run the run.sh|cmd script to start the MobileFirst Server 2. Start the MobileFirst Operations Console at http://localhost:9080/mfpconsole
MobileFirst Operations Console • Displays the following functions: ▪ Register and deploy applications and adapters ▪ Optionally download native/Cordova application and adapter starter code templates ▪ Configure an application's authentication and security properties ▪ Manage applications: Application Authenticity, Direct Update, Remote Disable/Notify ▪ Send Push Notifications to iOS and Android devices ▪ Generate DevOps scripts for continuous integration workflows and faster development cycles
MobileFirst Command Line Interface (CLI) • Download from https://mobilefirstplatform.ibmcloud.com/downloads/ • Requires NPM package manager; NPM is bundled as part of Node.js (https://nodejs.org/en/download/) • Verify the installation by running mfpdev –v • Enables you to: ▪ Manage MobileFirst Servers ▪ Register and configure applications ▪ Create, build, deploy, and test adapters
MobileFirst Foundation client SDKs • Set of API methods that allow you to implement various MobileFirst features, such as: ▪ Authentication and security mechanisms ▪ Notifications ▪ Resource requests ▪ Collecting analytics data ▪ And more • Provided as part of the Development Kit (or can be installed manually) • Provided for Cordova applications and native platforms: iOS, Android, Windows 8.1 Universal, and Windows 10 UWP
Installing Eclipse • Encouraged, if you plan on working with MobileFirst adapters, or if you plan on doing any Cordova or hybrid mobile application development • Download and install the Eclipse IDE for your platform from https://www.eclipse.org/downloads/ • Integrate MobileFirst Server: 1. From the Servers view in Eclipse, select New > Server. 2. If an IBM folder option does not exist, click Download additional server adapters. 3. Select WebSphere Application Server Liberty Tools and follow the on- screen instructions. 4. From the Servers view in Eclipse, select New > Server. 5. Select IBM > WebSphere Application Server Liberty. 6. Enter a server name and host name and click Next. 7. Enter the path to the server root directory, and select a JRE version to use. 8. Click Next, and then click Finish.
MobileFirst Studio and THyM • The MobileFirst Studio plug-in for Eclipse displays the various MobileFirst commands in the Eclipse IDE • The Hybrid Mobile Project (THyM) supports the importing and managing Cordova projects in Eclipse • Download and install from Eclipse Marketplace
Accessing MobileFirst commands in Eclipse • Right-click the root project directory and select IBM MobileFirst Foundation ▪ Open Server Console: Opens the console (mfpdev server console) ▪ Preview App: Opens the app in browser preview ▪ Register App: Registers the app with MobileFirst server (mfpdev app register) ▪ Encrypt App: Runs the web resource encryption tool on the app (mfpdev app webencrypt) ▪ Pull App: Retrieves the existing app configuration from the server that is specified in the server definition (mfpdev app pull) ▪ Push App: Sends the app configuration to the server so that you can reuse it for another app (mfpdev app push) ▪ Update App: Packages the contents of the www folder in a compressed file, and replaces the version on the server with the package (mfpdev app webupdate) • Enabling debug mode: Preferences > MobileFirst Studio Plugins > Enable debug mode > Apply > OK
Running the MobileFirst Server in Eclipse • From the Servers view in Eclipse, select New > Server • If an IBM folder option does not exist, click Download additional server adapters • Select WebSphere Application Server Liberty Tools and follow the on-screen instructions • From the Servers view in Eclipse, select New > Server • Select IBM > WebSphere Application Server Liberty • Provide a server name and host name and click Next • Provide the path to the server's root directory, and select a JRE version to use • Click Next followed by clicking Finish
Adapter tools and security checks • Require Apache Maven • Download and install from https://maven.apache.org/download.cgi • Add a MVN_PATH variable, pointing to the Maven folder • You can create adapters either by using Maven command-line commands, or by using the MobileFirst CLI • Optionally, you can install a Maven plug-in to Eclipse (http://www.eclipse.org/m2e/)
Cordova development • MobileFirst Platform Foundation supports Apache Cordova CLI 6.0.0, 6.1.1, 6.2 (v6.1.0 is not supported) • Requires Cordova CLI, which is distributed as an NPM package ▪ Download and install Node.js (https://nodejs.org/en/download/), and then use npm to install the cordova package ▪ From a command-line window, run the command: npm install -g cordova ▪ Verify the installation by running cordova –v • You can use your preferred code editor, but Eclipse is encouraged
Android development • Download and install Android Studio (http://developer.android.com/develop/index.html) • Use SDK Manager to install the required packages: ▪ SDK Tools ▪ SDK Platform-tools ▪ SDK Platform ▪ System Image ▪ Android Support Repository ▪ Google Play Services ▪ Google Repository • MobileFirst applications support the minimum API level that Cordova supports (in this case, Android API Levels 14 – 23) • Configure an Android Virtual Device by using the AVD Manager
iOS development • Register as an iOS developer at https://appleid.apple.com/account • Create an Apple ID (or use an existing one) • Sign in to https://developer.apple.com/ • In Member Center > Programs & Add-ons, register for the appropriate program for your organization • Install Xcode from https://developer.apple.com/xcode/
Unit summary • Install the MobileFirst Platform Foundation Developer Kit • Set up the MobileFirst Development Server • Install the MobileFirst Platform CLI • Set up the platform-specific IDE and tools
Exercise introduction • Download and install prerequisite software • Install the MobileFirst Platform Foundation Developer Kit • Install the MobileFirst Command Line Interface (CLI) • Install the MobileFirst Studio plug-in • Install an IDE for your platform