Transcript Mobile

IBM Worklight
mobile application development
Hatice MERİÇ
Technical Consultant
[email protected]
© 2012 IBM Corporation
Mobile
DISCOVERY PROCESS
- Understanding your mobile business requirements
- Defining your enterprise mobile strategy.
2
© 2012 IBM Corporation
Mobile
You need to identify the types of mobile applications
you need to develop, which could be mobile
*Web,
*Native,
*Hybrid,
or
*a combination of these
3
© 2012 IBM Corporation
Mobile
BECOME A REGISTERED DEVELOPER ON THE SUPPORTED
MOBILE PLATFORMS
In order to be able to deploy or publish your application via the
various mobile appstores (such as Apple’s App Store or Google
Play), all mobile platforms require anorganization or individual to
be a registered developer. Only registered developerscan submit
applications to a platform’s associated app store. Therefore, you
need toregister to these platform programs in the early stage of
your development lifecycle.
5
© 2012 IBM Corporation
Mobile
• iOS: To test an application on a real iOS device or to prepare your app for appstore
release, you need to enroll in Apple's iOS Developer Program as eitheran individual
developer or as a company. There is a fee associated with thisregistration.
• Android: Before you can publish an Android application to Google Play, you oryour
organization needs to set up a Google Play account. This is a three-stepprocess,
which includes creating a developer profile, agreeing to the DeveloperDistribution
Agreement, and paying a registration fee using Google Checkout.
• Blackberry: To publish a Blackberry application to Blackberry App World, youfirst
need to have a vendor account. Developers without a vendor account arenot be able
to submit applications for publication to BlackBerry App World.
• Windows Phone: Similarly, you must be a registered Windows Phonedeveloper to
submit your applications to the Windows Phone Marketplace.Registration can be
completed at the Microsoft App Hub.
6
© 2012 IBM Corporation
Mobile
PREPARE WORKLIGHT MOBILE APPLICATION
DEVELOPMENT ENVIRONMENT(cont.)
1- Installing Eclipse
2- Installing IBM Worklight Studio
3- Installing mobile SDKs
4- Prepare team development environment
8
© 2012 IBM Corporation
Mobile
PREPARE WORKLIGHT MOBILE APPLICATION
DEVELOPMENT ENVIRONMENT(cont.)
1- Installing Eclipse
Eclipse Juno 4.2.2 (Java Platform, Enterprise Edition, or
Classic). For Worklight v6.0
2- Installing IBM Worklight Studio
You can install IBM Worklight Studio after Eclipse has been installed.
There are three editions of Worklight Studio available: Developer
(which is available fordownload at no cost to get you started),
Consumer, and Enterprise. WorklightStudio can be installed from
Eclipse Marketplace, or using IBM InstallationManager, or as an
Eclipse plugin. For installation details, see the IBM Worklightproduct
library.
9
© 2012 IBM Corporation
Mobile
3- Installing mobile SDKs
If you plan to develop hybrid or native mobile applications with Worklight,you
need to install and configure the SDKs (and development IDEs) for
theassociated supported mobile platforms. The procedures might vary,
dependingon the platform, but here are steps you are likely to encounter with
some of thepopular mobile platforms.
iOS: You must download Xcode, which is an Apple IDE for
developingiOS and Mac applications. You can use Xcode to
manage your testingdevices, use an iPhone or iPad simulator,
and install applications on aniPhone or iPad device.
Android: You must install the Android SDK and Android Development
Tools (ADT) plug-in for Eclipse. The Android SDK provides the
tools and APIs that are required to develop applications on the
Android platform by using the Java™ programming language.
The ADT plug-in for Eclipse is an integrated environment in which
you can build rich Android applications.
10
© 2012 IBM Corporation
Mobile
• BlackBerry: WebWorks application development requires that you
download and install Blackberry Ripple Emulator,
Blackberry WebWorksSDK, and Blackberry Simulator.
• Windows Phone: You must download and install Microsoft Visual
Studio 2010/2012 and the Windows Phone SDK. You must
also download and install Zune software in your
development environment to run your applications on a
Windows Phone handset.
11
© 2012 IBM Corporation
Mobile
4- Prepare team development environment
Preparing the team development environment using, for example,
IBMRational® Team Concert, is an excellent idea for managing highly
dynamic mobile application development. Keep in mind, however, that when
managing Worklight applications with a source control system, some files
generated by Worklight projects should not be added to the source control
system.
12
© 2012 IBM Corporation
Mobile
DESIGN AND DEVELOP MOBILE
APPLICATIONS
Performing development of Worklight-powered applications in
WorklightStudio, development is also done using familiar web technologies
such as HTML,CSS, and JavaScript™, also supporting the latest HTML5 and
CSS3 standards.You can use the Worklight client-side SDK for crossenvironment UI services (suchas accessing the tab bar or menu of a mobile
device). Developers also have the flexibility to use their preferred JavaScript
libraries and UI toolkits.
Worklight does not limit the development process to coding in web
technologies only.It generates the native application project for the targeted
mobile platform in order tocompile the native package for distribution through
app stores. Device-specific native code can be added to these generated
native application projects and combined withcode written using web
technologies.
13
© 2012 IBM Corporation
Mobile
DESIGN AND DEVELOP MOBILE
APPLICATIONS
Performing development of Worklight-powered applications in
WorklightStudio, development is also done using familiar web technologies
such as HTML,CSS, and JavaScript™, also supporting the latest HTML5 and
CSS3 standards.You can use the Worklight client-side SDK for crossenvironment UI services (suchas accessing the tab bar or menu of a mobile
device). Developers also have the flexibility to use their preferred JavaScript
libraries and UI toolkits.
Worklight does not limit the development process to coding in web
technologies only.It generates the native application project for the targeted
mobile platform in order tocompile the native package for distribution through
app stores. Device-specific native code can be added to these generated
native application projects and combined withcode written using web
technologies.
14
© 2012 IBM Corporation
Mobile
UNIT TESTING IN THE DEVELOPMENT
ENVIRONMENT
Mobile browser simulator and app preview
 Mobile SDK simulator
 Actual device

15
© 2012 IBM Corporation
Mobile
1- Mobile browser simulator and app preview
IBM Worklight Server provides an app preview service that enables
you to simulate mobile web artifacts in a desktop web browser. App
preview also enables the simulation of Worklight client APIs. App
preview is available from the Worklight Studio test server console.
16
© 2012 IBM Corporation
Mobile
In the Worklight Studio development environment, you can preview and testyou
mobile application using the mobile browser simulator. The simulatorcontains a
frame that emulates a target device. You can switch the frame toemulate
different screen resolutions, form factors, and orientations for Android,iPad,
iPhone, Blackberry, and other mobile devices.
17
© 2012 IBM Corporation
Mobile
Unit testing your application with the mobile browser simulator provides
the convenience of not requiring the installation of the native SDK from
the device vendor. It also has fast application refreshing performance,
which makes the repetitive testing more efficient.
But the UI simulation does not always exactly match the actual UI
appearance on the physical device being emulated,especially with
regard to the spacing of text and other elements.
Therefore, thistype of unit testing is most suitable for early stage UI
testing of the overall frame and widget positions. It is also an efficient
tool for testing logic flowing in the mobile application.
18
© 2012 IBM Corporation
Mobile
While testing within the desktop web browser environment,
you have access to various popular debugger tools, such as the
built-in debugger tool from Chrome and Firebug from Firefox.
These tools let you set breakpoints in your JavaScript, view the
CSS rules applied to the generated HTML code, and view the
network traffic between your local application and the server. It is
also highly recommended to use web kit-based browsers, such as
Chrome and Safari. Another useful mobile web app debugging
tool, Weinre, which is an opensource tool, is also worth
considering.
19
© 2012 IBM Corporation
Mobile
2- Mobile SDK simulator
This type of unit testing involves a native mobile SDK simulator.
When a Worklight-generated native project for a mobile platform is
started (either through Worklight Studio or the vendor development
tool), a native OS window will pop up which runs the simulator with
the latest mobile application code. In contrast to the mobile browser
simulator, which tries to simulate the characteristics of many
devices, a mobile SDK simulator provides a simulatedUI that is
nearly identical to that of the actual device. However, the application
performance, such as the response time to touch, will be slightly
different from the real device. This is due to the different computing
power between the realdevice and the development workstation. For
the most realistic user experience test, you must test your
applications on actual mobile devices.
20
© 2012 IBM Corporation
Mobile
3 - Actual device
The ultimate test for mobile applications, this type of test must be
performedon the targeted devices to make sure the application UI and
performance areconsistent across all targeted devices. You must make
sure the real devicestays on the same wireless network as the
development workstation so it canaccess the embedded Worklight test
server within Worklight Studio.
21
© 2012 IBM Corporation
Mobile
- When an Android device is connected to the
computer via a USB cable,the Eclipse ADT plug-in
automatically recognizes it and attempts to deploy
applications onto it.
For an Android device whose driver is not listed
(such as Kindle Fire),the .apk file built into the
Worklight-generated native Android project can be
dropped to the device through the USB connection.
You can use the device’s installation utility to install
the apk file on the device.
22
© 2012 IBM Corporation
Mobile
- To deploy an iOS application onto a real iOS
device, you must have aprovisioning profile,
which you receive when you enroll in the
Apple iOS Developer Program.
.ipa
23
Normally, you start with a development
provisioning profile that enables Xcode to
recognize the connected iOS device througha
USB cable and install the application onto it.
In a later phase (such as integration test
phase or production), you will transition to a
distribution provisioning profile that permits
you to build, archive, and package the
application into an .ipa file with proper
signature, which can be deployed tothe device
through iTunes or the application center.
© 2012 IBM Corporation
Mobile
INTEGRATION TESTING IN REMOTE
WORKLIGHT SERVER ENVIRONMENT
To test your mobile application with full back end enterprise system
integration, the application needs to be installed in an integration or QA
environment that is readily available for any authorized testers.
IBM Worklight Server is only available in the Worklight consumer and
Enterprise edition.
-Prepare the integration environment
-Prepare Worklight project for deployment
- Deploy Worklight application and
adapter to the integration environment
-Test in the integration/QA environment
24
© 2012 IBM Corporation
Mobile
DEPLOYING TO PRODUCTION
Notice that several Worklight
Servers are set up in a
cluster environment,
sharingthe same database.
When a .wlapp or .adapter
file is deployed on one of the
serversin a cluster, it is
automatically synchronized
to other servers.
This is also true when
deleting the application or
adapter from a server in the
cluster. The .war file,
however,is a part of the
application server
customization; it must,
therefore, be deployed
manually to each server in
the cluster.
25
© 2012 IBM Corporation
Mobile
While the Worklight mobile application is being deployed to the
production environment, the native application package should be
assembled and published for distributing to the public.
For iOS devices, the publishing process will usually take a longer time
because of Apple’s review and approval process for its App Store.
Therefore, be sure to start the native package submission with enough
lead time.
For Android devices, there is no review and approval process, so
publishing is pretty quick.
The following link provides the guideline
For the Apple’s publishing process: https://developer.apple.com/appstore/guidelines.html
for the publishing process: http://developer.android.com/distribute/googleplay/publish/preparing.html
26
© 2012 IBM Corporation
Mobile
MANAGE THE WORKLIGHT MOBILE APPLICATION
Worklight mobile application management consists of two parts:

The native package managed through the platform app store.
The application web resources, which are packaged and deployed through
the Worklight console.

1-Direct update: Pushing app updates to mobile devices
2-Locking an app: Preventing redeployment of web resources for an
app
3-Denying access to older app versions
4-Displaying a notification message on app startup
27
© 2012 IBM Corporation
Mobile
1- Direct update: Pushing app updates to mobile devices
Using direct update, organizations can update the web content of
their deployed HTML5 and hybrid applications directly from the
Worklight Server up on application startup.
When the application connects to the Worklight Server,it detects the
new update automatically and starts downloading the newly
deployed resources after receiving confirmation from the user. This
option is available for iPhone, iPad, and Android apps.
28
© 2012 IBM Corporation
Mobile
2- Locking an app: Preventing redeployment of web resources for
an app
If you want to prevent developers or administrators from mistakenly
updating an application, you can lock it in the Worklight console. This
option is available for iPhone, iPad, and Android apps.
3- Denying access to older app versions
It is sometimes useful to deny a user access to a specific application
version due to phase-out policy or security issues present in the older
version. On the console, you can deny access to a specific version of the
application on aspecific mobile operating system and provide a custom
message to the user.Along with the message, you can also specify a URL
for the new version of theapp (usually in the applicable app store). The
user receives the message and is forced to close the app, or upgrade to
the latest version.
29
© 2012 IBM Corporation
Mobile
4- Displaying a notification message on app startup
Similarly, you can set a notification message that is displayed for the
user whenthe application starts, but does not cause the application
to exit. This type ofmessage is useful when you want to notify
application users with temporarymessages, such as a planned
system down time.
5- Controlling authenticity testing for an app
When an application first connects to the Worklight Server, the
server tests the authenticity of the application. This test helps to
protect applications against some malware and repackaging attacks.
This option is available for iPhone,iPad, and Android apps. You
needs to configure the application to enable authenticity testing.
30
© 2012 IBM Corporation
Mobile
https://www.ibm.com/developerworks/mobile/worklight/
http://www.ibm.com/developerworks/mobile/worklight/gettingstarted.html
31
© 2012 IBM Corporation
Mobile
Hatice MERİÇ
Technical Consultant
[email protected]
© Copyright IBM Corporation 2012. All rights reserved. The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind,
express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have
the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM
software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities
referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature
availability in any way. IBM, the IBM logo, Rational, the Rational logo, Telelogic, the Telelogic logo, and other IBM products and services are trademarks of the International Business Machines
Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.
32
© 2012 IBM Corporation
Mobile
Trademarks and Disclaimers
Copyright IBM Corporation 2012. All rights reserved.
• IBM, the IBM logo, ibm.com, WebSphere, DB2, Cast Iron, and Rational are trademarks or
registered trademarks of International Business Machines Corporation in the United States, other
countries, or both. If these and other IBM trademarked terms are marked on their first occurrence
in this information with the appropriate symbol (® or ™), these symbols indicate U.S. registered
or common law trademarks owned by IBM at the time this information was published. Such
trademarks may also be registered or common law trademarks in other countries. A current list of
IBM trademarks is available on the web at “Copyright and trademark information” at
www.ibm.com/legal/copytrade.shtml.
• Adobe is either a registered trademark or trademark of Adobe Systems Incorporated in the
United States, and/or other countries.
• Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
• Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other
countries, or both.
• Java and all Java-based trademarks and logos are trademarks or registered trademarks of
Oracle and/or its affiliates.
• Other company, product, and service names may be trademarks or service marks of others.
• Information contained within is for informational purposes only, and is provided 'as-is' without
any warranties, either expressed or implied. References in this publication to IBM products or
services do not imply that IBM intends to make them available in all countries in which IBM
operates.
33
© 2012 IBM Corporation