© 2015 IBM Corporation
Building Effective Applications with the IBM MobileFirst Platform
Andrew Ferrier [email protected] Technical Lead, IBM Cloud Lab Services EMEA
Agenda • Review of IBM MobileFirst Platform • Tips:
• #1: Choose your client-side architecture wisely • #2: If you’re going hybrid, think about your tools • #3: Do Continuous Integration • #4: External properties for environment promotion • #5: Think about deployment to phones • #6: Consider your tests • #7: Consider adapter versioning
• Further Learning
1
What is MobileFirst Platform?
Mobile Enterprise Application Platform = A platform for construction of hybrid and native mobile applications, along with supporting mobile backend services such as service adapters, unified push notifications, a unified security and authentication framework, operational analytics, and so on.
2
3
4
JMS Queue / Topic
Web / RESTfil service DB
HTTP (REST, SOAP)
SQL JMS
HTTP (CAST IRON)
JSON
Adaptors MobileFirst SERVER
Cloud Service
Windows
Android Blackberry Apple
Adapters
Tip #1: Choose your client-‐side architecture wisely
3 different ways to write the client-‐side…
(we’re not considering Windows Mobile, Blackberry)
NaFve (aka NaFve API)
Xamarin HTML5 (aka Hybrid)
Hybrid • (aka Web, Cordova, etc.) • Core skills: HTML, CSS, JS, and a JS toolkit
8
MFP Studio
Xcode
Android Studio
HTML CSS JS
Framework / Toolkit
Your App
MFP CLI
• Apache Cordova -‐ hSp://cordova.apache.org/
• Previously known as PhoneGap
• Provides a wrapper around web content to make it appear as a naFve app
• Also provides access to device APIs
Cordova enables Hybrid
JS Toolkits
• AngularJS + Ionic • Dojo Mobile • jQuery + jQuery Mobile • Sencha Touch • Many many others…
• ‘What all the cool kids are using’ • Maintained by • Focus Areas:
• One-‐page applicaFons • MVC – strong data binding
capabiliFes • Not specifically focused on mobile
applicaFons, so…
• AngularJS + Ionic is a good ‘default’ choice. • There are established paSerns and examples for using it with MobileFirst Pla_orm:
• Open-source toolkit, IBM has some involvement in development.
• ‘All-in-one’ toolkit answer • Latest version (1.10.x) brings iOS 8
support • Strong support for structuring large
applications • e.g. AMD, Class system (dojo/declare), dojox/app
• Good option for multi-channel or desktop apps
• Good option for Blackberry or other esoteric platforms
• NOT • Focuses on ‘core’ funcFonality:
• DOM traversal and manipulaFon
• Event Handling • AJAX / XHR
• Mobile Framework separate:
Tip #2: If you’re going hybrid, think about the tools…
• Frameworks such as Bootstrap, Ionic, etc. can help a lot in creating the quality and performance you need for hybrid
15
• Module systems/Loaders: RequireJS/AMD, Dojo/AMD, CommonJS, ExtJS define, Flight/AMD, YUI.use()
• Package manager: Bower, Dojo Packages, CPM, Volo, yeoman
• Build systems: r.js(requirejs), dojo build, Component, ClosureBuilder, Shiger, grunt
• Templates: AngularJS, Hogan.js, Mustache.js, Handlebars, Dijit templates, UnderscoreJS, Lo-‐Dash, Y.Template.Micro
• Data Binding: ReacFve, Rivets, Knockout, Backbone, AngularJS, Flight, Dojo Observable
• Rou>ng: dojo/router, Backbone • App Controllers: dojox/app (+ISSW), Backbone,
AuraJS • Sync: component/model, AngularJS services, Dojo
Object Store, YUI, Backbone Sync • Widgets: Closure Library, Dijit, Dojo mobile,
jQuery/jQuery Mobile, etc.etc., Bootstrap (jQuery), YUI, Sencha, EXTJS
• Bower - Package Management – bower.io
• Grunt – ‘Task Runner’ – gruntjs.com
Android NaFve
• Use Java to code against Android SDK • Use Android Studio (hSp://developer.android.com/sdk/index.html) -‐
based on IntelliJ • Eclipse plugins (ADT) will likely be phased out
Android NaFve -‐ Concepts
= OR
iOS NaFve -‐ UIKit
• On iOS, you broadly have two technology choices: • ObjecFve-‐C – Older, harder to learn • Swig – Only introduced in 2014.
iOS NaFve
• For all apps (not just naFve), you need to register to deploy to “real” devices
• Also need Xcode development environment (only supported on Mac)
How can we mix all of these?
• Two basic styles: • Hybrid web container is master -‐ in MobileFirst Pla_orm, this is a
Hybrid applicaFon (i.e. Cordova) • NaFve code is master -‐ in MobileFirst Pla_orm, this is a Na>ve API
applicaFon
Xamarin • Build applications natively in C# for Android and iOS • Develop business logic in C# • Develop UI design either in Xamarin.Forms (common cross-
platform) or in native tools/code
21
Summary – so which is best?
• AngularJS + Ionic is a good default choice for those with web skills
• Maximises cross-‐pla_orm compaFbility • Disadvantages: tuning, Android variants
• iOS NaFve and Android NaFve are best for those looking for the most sophisFcated cupng-‐edge UX
• Disadvantages: Typically requires more in-‐depth, specialised skill.
• Xamarin suitable for naFve developers with C# skill
Tip #3: Do ConFnuous IntegraFon
MFP Server
Key artifacts
Server-side
• .war • (aka Project / customisation
WAR – not to be confused with MFP administration WAR)
• .wlapp • Per-application content,
a.k.a. application understanding
• .adapter • Per-adapter
24
Client-side
• .ipa • Application for iOS
• .apk • Application for Android
Building Artifacts
• MFP provides the <war-builder>, <app-builder> and <adapter-builder> ANT tasks • Only builds the Server portion of the projects -
the .war customisation file, the .wlapp file, and the .adapter files.
• You will need to build the .apk and .ipa files using platform-native process.
• You need a Mac for iOS
Tip #4: Externalise properties for environment promotion
• worklightserverhost in <app-builder> task – also can be exposed through user screen:
<iphone bundleId="com.ibm.myapp" version="1.0”>!!<worklightSettings include="true"/>!
…!</iphone>!
Tip #4: Externalise properties for environment promotion • server/conf/worklight.properties!
!!
!worklight.properties contains:!!myadapter.path = /mypath/somerestservice!!!
Which becomes JNDI property: <property name="myadapter.path" value="/myserver/somepath/service"/>!
27
For more information: http://tinyurl.com/losx42b)!
Tip #4: Externalise properties for environment promotion • domain, port for the backend service in adapter.xml
28
Deploying
• Deploy the .war using relevant application server method
• Deploy the .wlapp and .adapter server-side portions of the application using <app-deployer> and <adapter-deployer> ANT tasks.
• Deploy JNDI properties.
Tip #5: Think about deployment to phones • You still need to get the native
application (.ipa, .apk, etc.) onto your user’s phones. • Dev Time/Small/Adhoc
Projects: Manual install • Testing lifecycle:
AppCenter - comes with MobileFirst server editions – Install via AppCenter Web or
AppCenter App
Tip #5: Think about deployment to phones
• B2C: public App Stores (Apple App Store, Google Play Store)
• B2E: IBM Endpoint Manager (MaaS360) or similar
31
Tip #6: Consider your tests
• Typically you’ll want to test: • Manual UI on physical phones – Coverage across devices
• Automated UI – e.g. MobileFirst Test Workbench
• (MFP) Adapters – unit / integration performance tests
Automated Adapter Testing
33
MobileFirst Server Backend
Adapters
Automated Adapter Testing • Uses HTTP RPC API to drive adapters:
• (good tools are and )
• Unit Testing can be achieved by driving individual adapters with stubbed backends
• Store properties in worklight.properties, use them in the .js to find URL
• Integration Testing can be achieved by connecting adapters to a real backend
• Performance Testing can be achieved by driving adapters hard over an extended period and plotting the results
34
Tip #7: Consider Adapter Versioning • Two mechanisms for versioning MFP Adapters:
• Renaming them • Provide a version as additional metadata on each adapter call:
myAdapterProcedure(options, a, b…)
var options = { version: { major: 1, minor: 0, patch: 0 } }
WL.Client.invokeProcedure({ adapter : "RSSFeed", procedure : "getData", parameters : [options, "myTopic"]
});
Tips - Review • #1: Choose your client-side architecture wisely • #2: If you’re going hybrid, think about your tools • #3: Do Continuous Integration • #4: External properties for environment promotion • #5: Think about deployment to phones • #6: Consider your tests • #7: Consider adapter versioning
36
Find out more…
37
https://developer.ibm.com/mobilefirstplatform/
Further Learning – Other Resources • http://ibmmobiletipsntricks.com/
• MobileFirst Test Workbench: http://tinyurl.com/m8n32ry
• Using AngularJS and Ionic: http://youtu.be/a89W_atlhjg
• IBM Worklight AngularJS + Ionic template: http://git.io/AffP
• CI & Automated Testing with Worklight: http://tinyurl.com/nzng5lc
38
Notices and Disclaimers Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.
Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided.
Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.
Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.
References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business.
Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.
It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law.
Notices and Disclaimers (con’t)
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right.
• IBM, the IBM logo, ibm.com, Bluemix, Blueworks Live, CICS, Clearcase, DOORS®, Enterprise Document Management System™, Global Business Services ®, Global Technology Services ®, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, SoDA, SPSS, StoredIQ, Tivoli®, Trusteer®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
Thank You Your Feedback is
Important!
Access the InterConnect 2015 Conference CONNECT Attendee Portal to complete your session surveys from your smartphone,
laptop or conference kiosk.
Top Related