Create Simple Java Adapter for MobileFirst Foundation 8.0 IBM – Eclipse

Create Simple Java Adapter for MobileFirst Foundation 8.0 IBM – Eclipse

1.) Open Eclipse ( I used Eclipse Mars) , Create New Maven Project in Eclipse.

mavenproj_adapter.jpg

2.) Add the Archetype (using – adapter-maven-archetype-java) :

mavenproj_adapter2.jpg

3.) Add the Group Artifact.

Group id : (is your domain) com.fndong.mfp

Artifact id:(Your Project name) AdapterMfp

mavenproj_adapter3.jpg

  • Click Finnish button.

mavenproj_adapter4.jpg

  • It will generate the structure of java project with pom.xml

4.) Building an adapter. – Using cmd windows with mfp -mobilefirst CLI.

  • Go to Root project , type this command : mfpdev adapter build

mavenproj_adapter5.jpg

5.) Run the MobileFirst Foundation Server 8.0, so you can deploy the adapter to console.

  • Run Mobilefirst CLI command : mfpdev adapter deploy -x

mavenproj_adapter6.jpg

6.) Check the mobilefirst console :

console_adapter.jpg

7.) Testing the AdapterMfp application, Click Adapter application and click tab Resources > Click button View Swagger Docs.

7.1.) test the Restful GET

test_get_rest.jpg

 

Adding the IBM MobilFirst SDK to Android Application – Hello World

Good Day! & Happy New Year 2017 Gregorian Calendar

1.) Create New Project in Android Studio. Select File > New Project.

2.) Enter new Project, add the name for the project with the name of the package, example:

New Project name : MyApp

company domain : com.fndong.myApp

3.) Then After created, adding the SDK into android MyApp Application.

3.1) Add the sdk plugin mobilefirst android in build.gradle (Module:App).

apply plugin: 'com.android.application'
repositories{
    jcenter()
}
android {
    compileSdkVersion 23
    buildToolsVersion "25.0.2"

    packagingOptions {
        pickFirst 'META-INF/ASL2.0'
        pickFirst 'META-INF/LICENSE'
        pickFirst 'META-INF/NOTICE'
    }

    defaultConfig {
        applicationId "myapp.com.fndong.myapp"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.ibm.mobile.foundation:ibmmobilefirstplatformfoundation:8.0.+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
}

4.) Add the Permission and the Mobilefist UI activity in the AndroidManifest.xml.

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  • add inside tag <application…>
<activity android:name="com.worklight.wlclient.ui.UIActivity" />

5.) Running emulator – just go here android_page

6.) Go to Run – app / (Shift+ F10) – then it will show your first Mobile App with Mobilefist SDK for Android.

android_mobilefist.jpg

7. Add the registration of the application with mobilefirst server – and add the mfpclient.properties

  • using node.js prompt – set this command : mfpdev app register (must run the mobilefirst Foundation server 8.0 – for console first)

Create Cordova Application Project (Client) using MobileFirst CLI

Create Cordova Project using MobileFirst CLI (IBM Site)

1.) First , open node.js command prompt ( for windows OS), in the workspace Start create Project > (cmd) – cordova create myFirstCordova com.fndong.HelloWorld –template cordova-template-mfp

cordovaCL1.jpg

2.) After Created, add the Android platform, I’ll using android version android@5.1.1. Go to directory project myFirstCordova > run command : cordova platform add android@5.1.1.

cordovaCL2.jpg

3) set the config.xml which will added elements such as mfp, server, locale and Extensions. Command : mfpdev app config

cordovaCL3.jpg

4.) Register Project Cordova to MobileFirst Console Server. command : mfpdev app register.

run the cordova prepare:

cordova prepare

 5) To run the App in IBM Simulator. command : mfpdev app preview.

7) Creating Adapter

Create a Cordova mobileFirst Project in Eclipse Mars 2

 Create a Cordova mobileFirst Project in Eclipse Mars 2.

1.) Create new Project Cordova ,  Right Click > New > Hybrid Mobile(Cordova) Application Project > Next > (and add the Project Name: , Name:, ID:)

cordova1.jpg

2.) (Get the mobile Engine – download android sdk 5.1.1) Next > Download .. choose option SDK Android 5.1.1

cordova2.jpg

3.) Add the Cordova Plugin – mfp* , select – cordova-plugin-mfp.

cordova3.jpg

4.) Select to confirm plugins to be downloaded from registry.

cordova4.jpg

5.) Finish.

6.) Deploy and Start your application on MobileFirst Console Foundation 8.0

6.1.) Start the Server MobileFirst Console Foundation 8.0.

  • Here I’m using cygwin (linux in windows) terminal to run MobileFirst.

cordova5.jpg

  • //MobileFirst-8.0.0.0
  • $ sh run.sh

7.) Make sure your console up like below image:

cordova6.jpg

8.)Edit your index.html to change the view of your first page App mobile.

cordova10

  • change the html code ( I just added the blue lines) :
 <body>
        <h1>This your First Application</h1>
        <h2>Welcome to cordova mobileFirst</h2>
        http://cordova.js
        http://js/index.js
    </body>

9.) In Eclipse , Right Click Project > IBM MobileFirst Platform Foundation > Register App.

cordova8.jpg

10.) To run Application to Emulator IBM, Right Click Project > IBM MobileFirst Platform Foundation > Preview App. Automatically will load to the browser – emulator.

cordova9.jpg

Selamat Berjaya….2016 – Donald Trump Won USA Presidency

Create Cordova mobile App using IBM MobileFirst Foundation 8.0 + Eclipse Mars + Android v 5.1.1 + Node.js + Java 8

Create Cordova mobile App using IBM MobileFirst Foundation 8.0 + Eclipse Mars + Android v 5.1.1 + Node.js + jdk 8.

1.) Prerequisite.

1.1) MobileFirst Foundation Development Kit : Download
1.2) A Mars 2 Java EE version of Eclipse, or later. : Download
1.3)  Jdk version 8 : Download
1.4) Node.js version 4.x, or later. : Download
1.5) The Cordova command-line interface, version 6.1.1, or later.
1.6)  The IBM MFP Command Line Interface (CLI).
1.7) Android Version 5.1.1. (Just Download using eclipse Mars)

2) After Download MobileFirst Foundation Development Kit – take version 8.0, Installed.

  • To test the server MobileFirst Foundation 8.0, $ sh run.sh.

1.jpg

2.1.) Check the http://localhost:9080/mfpconsole/index.html#/dashboard

2.jpg

3) Install Eclipse Mars or later.

4) After Installed Eclipse Mars, get the IBM Mobilefist Plugin 8.0, Help > Eclipse MarketPlace..

3.jpg

5.) get Thym 2.0 Plugin, for developing Hybrid Mobile Application.

4.jpg

6.) After node.js installed, run the cordova  command-line on Windows:

  • checking node version
node -v
  • Installing cordova.

   npm install -g cordova

7.)  Add the plugin Android Development Tools.

5.jpg

7.1.) after added the ADT, make sure to installed Android 5.1.1 SDK.

6.jpg

8.) Add the The IBM MFP Command Line Interface (CLI) into node.js.

  • Command-line window, run the command: npm install -g mfpdev-cli.

9.) (Next tutorial) – Start creating a Cordova mobileFirst Project in Eclipse Mars 2.