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)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s