Вы находитесь на странице: 1из 18

Lab Exercise

Lab: MobileFirst Application


Management
Lab Exercise

IBM Software

Table of Contents
1.1
1.2
1.3
1.4
1.5

Page 2

LAB OVERVIEW .................................................................................................................................................................................. 3


TEST APPLICATION WITH MOBILEFIRST SERVER ....................................................................................................................... 4
DEPLOY NEW VERSION OF APPLICATION TO MOBILEFIRST SERVER ....................................................................................... 9
PUSH WEB RESOURCE CHANGES TO DEVICES VIA DIRECT UPDATE .......................... ERROR! BOOKMARK NOT DEFINED.
USING THE MOBILEFIRST OPERATIONS CONSOLE TO SEND APP STATUS NOTIFICATIONS ............................................... 15

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

1.1

Lab Overview

In this module, we will explore the application management and administration functions of IBM
MobileFirst via the MobileFirst Operations Console. Specifically we will deploy an initial version of the
IBMBank application outside of MobileFirst Studio to a MobileFirst Server, and then publish a new
version to see how MobileFirst Server can push new application code out to client devices directly.
This feature (Direct Update) allows changes in hybrid resources to be delivered to the MobileFirst Server,
and distributed directly down to client devices, without a re-install of the application from an app store.
We will also exercise the MobileFirst Operations Console to send application status notifications to client
devices (e.g. to communicate about outages, new versions, or other useful notifications).
MobileFirst Operations Console is a component within IBM MobileFirst that allows administrators to
manage applications. Administrators can use the console to see all applications that are installed and all
the device platforms that are supported, to disable specific application versions on specific platforms and
to force users to upgrade the application before they continue to use them. Additionally, the console can
be used to send out notifications to application users, and to manage push notifications from defined
event sources to applications. Administrators can also use the MobileFirst Operations Console to install
and manage adapters that are used by applications. Other features provided by MobileFirst Operations
Console include controlling authenticity testing for applications, and monitoring devices that have
contacted the MobileFirst Server (by running the applications).
IBM MobileFirst Foundation provides several means to administer and manage mobile applications:
The MobileFirst Operations Console, which has been briefly explained above
The <wladm> Ant task
The wladm command-line interface utility
The MobileFirst administration REST services
In this lab, you will take the role of an administrator rolling out a new version of the IBMBank application
for direct update to client devices, and sending notification messages to users of the application:

Test mobile app on Android emulator with MobileFirst app deployed to the MobileFirst Server

Publish a changed version of the application to the MobileFirst Server and see Direct Update
in action pushing changes to the Android emulator

Configure status notifications via MobileFirst Operations Console and see the notifications
appear on the Android emulator

Lets get started!

Lab 1

Page 3

IBM Software

1.2

Test application with MobileFirst Server

__1.

You will need to know the IP address you are on, so go to command prompt and type ipconfig.
Then note down the IP address you will need it in a couple of steps.

__2.

Locate the MobileFirst Platform folder on your desktop and double-click on Start MFP
Server.bat and Start MockServer.bat.

This will start our MFP Server as well as the Liberty Server hosting our mock REST services
which provide account information in this scenario. Wait for both to start completely.
__3.

Open the Chrome browser and navigate to http://localhost:9080/worklightconsole and log in


with admin/admin. We will now install our application on the MFP Server.

__4.

You may see previously deployed applications already in the console, so lets remove these
before we continue. In the console, under available runtime environments, inside IBMBank, click
on Applications. Click the X to delete any preexisting IBMBank app as shown, and Confirm.

__5.

You will see the application has been deleted.

__6.

Similarly click back to Home and click on the Adapters link under the IBMBank project. Delete
both adapters that may exist on this page AccountAdapter and AccountDetailsAdapter. You
will see a confirmation message when both adapters are deleted and no adapters should show
in the view.

Page 4

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

__7.

Lab 1

Click back to Home. Now we will install the initial version of the IBMBank application for this lab.
Under IBMBank, click on Select File. Select the IBMBankApp-all.wlapp file from
C:\MobileFirstLabs\imports\appmgmt\server\begin on your file system. Click OK and the app
will deploy onto the server. You will see a confirmation message that the app was deployed. If
you see a warning that application authenticity is disabled on the app, disregard for now as it
does not affect this lab.

Page 5

IBM Software

__8.

In the same way, from the Home screen, click Select File again and deploy both adapters from
the C:\MobileFirstLabs\imports\appmgmt\server\begin folder. You will see two messages
confirming successful deployment of the adapters. Your screen should look like the following
with Applications (1) and Adapters (2):

__9.

We are now complete with our deployment of artifacts on the server side for this lab. You can
minimize the Chrome browser for now, as we will pick it back up later.

__10.

Next we will make a minor change to our mobile client application so that we can test it against
the deployed MobileFirst application on the server. Open MobileFirst Studio by clicking the icon
on your Quick Launch bar at bottom of desktop and make sure to choose the
C:\MobileFirstLabs\workspaces\appmgmt workspace at launch.

Page 6

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

__11.

Wait for a few moments as the Eclipse workspace builds. You will see the IBMBank application
structure and code in the Project Explorer. Expand the folders from IBMBank to apps to
IBMBankApp and then option-click that folder. Choose Run-As, Build Settings and Deploy
Target as shown.

__12.

In the next dialog, you will want to enter your own IP address from step 1 above where indicated
in the screenshot (your screen will differ from the screenshot). Make sure that the port stays at
9080 and the context path is /IBMBank. We are configuring this so that the mobile app will be
able to reach the external MobileFirst Server rather than the MobileFirst Dev Server in Studio.
Click OK.

Lab 1

Page 7

IBM Software

__13.

Next, right-click on IBMBankApp again and choose Run As Build All Environments. Wait until
the build of all artifacts is complete. You will see a message in the Console view that says:
Application IBMBankApp with all environments build finished.

__14.

To test the application, return to MobileFirst Studio, right click on the


IBMBankIBMBankAppAndroid project, select Run As->Android Application
The mobile application (APK) will be uploaded to the AVD and started.
If prompted with the Auto Monitor Logcat pop-up, select yes and OK to continue. This will
cause the logcat console to surface in the Eclipse console view as logcat messages arrive.

__15.

When the application launches in the Android emulator, log into the app with demo/demo as
credentials. Click on Accounts and then Checking and Savings. You should see the application
provide account overview and account details.

This means that the mobile app in the Android emulator is successfully connecting to the
MobileFirst Server. However, click on the back button until you are back at the Home screen.
Click on the Markets section. Nothing happens. Oops, something has happened to break the
build and we have published an app with a major missing feature our markets page.
Direct Update to the rescue! The next time our users log in, we want them to get our update
immediately. In the next few steps you will see how easy it is to roll out this critical fix to an
existing deployed app.
Minimize the emulator for now as we will use it again later.

Page 8

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

1.3

Deploy update to existing application on MobileFirst Server


We will now explore what happens when an update is rolled out to an existing application
version. You will see that hybrid applications can be directly updated to the device from the
MobileFirst Server. The Direct Update Feature is useful for updating applications in between
new numbered versions, for example providing critical fixes or time-urgent new functionality.

__1.

Open the Chrome web browser again navigating to http://localhost:9080/worklightconsole and (if
not already logged-in) log into the MobileFirst Platform Operations Console. Enter admin for
username and admin for password and click OK.

__2.

In the console that opens you will see the currently deployed IBMBank application on the server,
which is at version 1.0 which we just deployed, by clicking on Applications, then IBMBankApp.

We will be rolling out a direct update of this application by installing a new version 1.0 with critical
fixes. In our case, we inadvertently made a breaking change that caused the Markets page to be
inaccessible. We will roll out the fix to this to respond quickly to user feedback.

Lab 1

Page 9

IBM Software

__3.

Click back to Home at the top of the screen, click on Select File, and browse to the file
C:/MobileFirstLabs/imports/appmgmt/server/end/IBMBankApp-all.wlapp and click Open.

__4.

As before, you will see messages indicating the app is uploading, then deploying into the
MobileFirst Server. You will see a successfully deployed message, with a warning, which you
can safely ignore.

Page 10

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

__5.

Click on Applications, then IBMBankApp, and now you will see that the app has a new build date
and time, along with showing your previous build time.

Now the server has the updated resources it will be able to provide a Direct Update to the app
on the device. We will proceed to test this again using our Android emulator and see Direct
Update in action.

1.4

Test updated application on Android emulator

__1.

You should have the Android emulator from the previous lab already running. We need to
ensure that we start a new session of the app in order to show the Direct Update feature, by restarting the IBMBankApp.
On the Android emulators home screen, find the Settings icon on the screen, then Apps.
Click IBMBankApp on the list to open the apps setting, and then click Force stop button.
Click OK to confirm the force stop.

Lab 1

Page 11

IBM Software

Page 12

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

__2.

Now click the Home button in the Android emulator to return to the home screen, click the Apps
icon, and re-launch the app by clicking the IBMBankApp app icon.

__3.

On the login page, log into the app with demo/demo.


This action will initiate a connection to the MobileFirst Server, and once the user is
authenticated, the server will check for new web resources for Direct Update. If new resources
are available, there a notification dialog box will display on the app. Click the Update button to
update the app and you will see the update download onto the device.

Lab 1

Page 13

IBM Software

__4.

Page 14

As mentioned, Direct Update will be checked on the MobileFirst Server when the client app
makes a connection to the server (e.g. by adapter procedure invocation, explicit connect API
call, etc. in the JavaScript code, depending on the application). In addition, the default setting is
for direct update to only be checked once-per-session (which was why we restarted the app
above, to ensure that Direct Update will be displayed). However, developers have the flexibility
to override this default behavior by using the MobileFirst API.

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

__5.

Once the Direct Update has completed, the app will automatically restart. Login to the app again,
and navigate to the Markets page. You will see this page is now live and shows our simulated
markets page functionality.

__6.

Click on the back button on the Markets page to return to Home page, and minimize the Android
emulator.

1.5

Using the MobileFirst Operations Console to send app


status notifications

__1.

Maximize the Chrome browser, which should still be open to the MobileFirst Operations Console
and the Catalog tab should be visible showing IBMBankApp.

__2.

Notice that each device app has a version (1.0) and a status (Active). We are going to send a
maintenance notification for the Android version of the application. Click the dropdown next to
Application Access and notice the choices of Active, Notifying and Access Disabled.
The Access Disabled choice is used when all access to an application by any device of that
type should be disabled. We will select Active, Notifying so we can send an informational
notification. Click on Active, Notifying from the dropdown.

Lab 1

Page 15

IBM Software

__3.

You will find that a window appears where you can enter the notification text. Enter a notification
of your choice, such as New version 2.0 coming January 26th with enhanced funds planning!.
Click Save.

__4.

You will see a message at the top of the console like the following:

Page 16

MobileFirst Platform 7.0 POT Application Management Lab

IBM Software

__5.

Minimize Chrome and maximize the Android emulator. Force stop the IBMBank application as
before and relaunch it. Once logged in again, you will see a Service Notification displaying the
message that you have just entered via the Operations Console.

Similar to Direct Update, any notification messages entered via the MobileFirst Operations
Console will be delivered to the corresponding app when the app makes a connection to the
MobileFirst Server (e.g. by adapter procedure invocation, explicit connect API call, etc).
__6.

Click Close to dismiss the message. You have now seen how the MobileFirst Operations
Console can be used to notify application users of important announcements such as updates or
service notifications.

__7.

Lets exercise one more function in the Operations Console. Click the dropdown which says
Active, Notifying that we set in step 3 above for the Android 1.0 version, and choose Access
Disabled. Enter some text in the notification giving a reason for disabling access to that version,
such as Must upgrade to supported version (1.5). You could also provide the URL for this
application version in the next box but we will skip for now. Click Save. You will see a message
at the top of the screen indicating the version 1.0 in Android is disabled.

Lab 1

Page 17

IBM Software

__8.

As before, force stop the application in the Android emulator and relaunch. This time as soon as
the application is launched you will see the following message:

This feature can be very useful if a problem has been found in a particular application version or
if you need to require users to upgrade their version.

Congratulations! You have completed the Application Management lab!

Page 18

MobileFirst Platform 7.0 POT Application Management Lab

Вам также может понравиться