Beyond the Mobile Browser – Building Rich Mobile Applications for IBM Lotus® Domino®John M. Wargo | Director, Industry Solutions PracticeAT&T Mobility
2
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of IBM Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
3
About this Session● Explore the differences between rich client and browser-based applications
for mobile devices● Learn how to use Lotus Domino Web Services to deliver data to mobile
applications● Learn how to build rich mobile applications to access your Domino
databases▬ BlackBerry© JavaTM application▬ Microsoft Windows Mobile© application▬ Others (possibly Google Android© Application)
● Targeted at Domino Developers
4
About Me● Director, Industry Solutions Practice for AT&T Mobility focusing on
Emerging Mobility Solutions● Developer, worked for Research In Motion for 2.5 years● Certified Notes developer since Notes 2.0 (before buttons) all the way
through Notes 8● Creator of award winning Automated Deployment
Toolkit and ConfigSave for Lotus Notes● Responsible for two IBM Beacon Awards
▬ Biggest Business Impact in 1997▬ Best Tool/Utility 2001
● Author of BlackBerry Development Fundamentals(www.bbdevfundamentals.com)
●Home: www.johnwargo.comTwitter: @johnwargo
5
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
6
Deciding on the Right Client● Depends on your audience
▬ Are there a limited number of client platforms you need to build for?
▬ The browser is a great common denominator for most all mobile devices● Will your mobile users need to interact with the data locally?
▬ Can’t really do that with a browser application unless you use something like Google Gears
▬ Browser application wouldn’t “run” when the radio is off (airplane mode) or when the device is out of coverage
● Will your application need to interact with other device applications (calendar, tasks, email)?
● Will the application need to function in areas with limited cellular coverage?
7
Strengths of the Mobile Browser● Uses standards-based technologies
▬ HTML, XHTML, CSS*, JavaScript*, AJAX*● Allows you to build once and run many places
▬ Pretty much every network-connected mobile device has a browser● Leverage your core skills as a Domino/Web developer● Most of your work has already been done if the application is already
browser-enabled▬ If so, your users could use your application in the same client (browser) only on different
machines● No application to deploy
8
Weaknesses of the Mobile Browser● Slow!● Both data and layout information delivered over the air (OTA)● Limited in capabilities (it’s only a browser after all)● Limited interaction with other applications on the device
(and their data too)● Limited ability to keep its data local without resorting to third-party tools● Complicated business logic runs on the server
9
Browser Limitations● If you haven’t Web-enabled your application yet, you’ve got a lot of work to
do▬ It’s easier if your business logic is in libraries rather than coded into forms or views
● Read only Document Object Model (DOM) on many devices▬ Means you may not be able to mimic rich client capabilities in the browser
(hide div's, change content on the fly and so on)● Can’t code to the latest version of the browser
▬ Not all of your devices will be running the latest version of the OS/handheld code● Not all mobile devices support Adobe Flash
10
Strengths of the Rich Client Platform● Fast!● Can do just about anything it wants on the device
▬ Easily store and manipulate data locally▬ Easily interact with other device applications and application data▬ Can create contacts, calendar appointments, tasks and more...▬ Interact with hardware components (camera, Bluetooth scanner, etc.)
● Complicated business logic runs in the client● Did I mention it’s fast?
11
Weaknesses of the Rich Client Platform● May require a different set of skills than the typical Domino developer has● Rich client applications can be much harder to create than browser
applications● May not run on multiple device platforms▬ Depends on which technologies you used to build the application
▬ Java?▬ .NET
▬ It would be great if there was a single cross platform option, but it’s actually getting worse with iPhone and Android
12
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
13
The Power of Domino Web Services for Mobile Devices
● Web Services are really easy to build in Notes Designer 7.x and 8.x▬ Especially if you’ve already separated your business logic from the application ▬ We'll discuss two types: XML-Based Web Services and RESTful Web Services
● Allows multiple clients to easily access your business logic and data ▬ Build the business logic once into a Web Service then add client after client (including
Notes) until you’re done● Easily facilitates application to application communication – even across
servers
14
Multiple Client Options
15
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
16
Domino Directory Lookup● The sample application performs a simple lookup against the Domino
Directory▬ Every Domino shop has at least one extra Domino Directory they maintain (right?)
● How it works▬ Requester passes in a partial last name▬ Service returns a list of names that match the search string▬ Requester selects name▬ Service returns some of the fields from that contact’s Person Document in the database
● The two operations of the service are connected
17
Web Service Shell
18
SOAP Message FormatTo consume from a Java application, the Web service must use Doc/Literal SOAP message format
19
The Code: Defining Variables'Some Notes objects we'll needDim db As NotesDatabaseDim s As NotesSession
20
The Code: Two Classes'The following class defines an array of strings'that will be returned by the function GetUserListClass UserListPublic users() As StringEnd Class
'the following class defines the user details 'that we will be returning for a detailed lookupClass UserInfoPublic FirstName As StringPublic LastName As StringPublic FullName As StringPublic EmailAddress As StringPublic OfficePhone As StringPublic MobilePhone As StringEnd Class
21
The Code: Defining the Main ClassClass DomDirLookup Sub New //Initialization Code goes in here End Sub
Function GetUserList(searchStr As String) As UserList //Code goes in here End Function
Function GetUserDetails(searchStr As String) As UserInfo //Code goes in here End FunctionEnd Class
22
Demonstration
23
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
24
Building a BlackBerry Java Client1) Generate the web services stub classes2) Create a new BlackBerry Java project3) Import the stub classes4) Write your code
25
Generating the Web Services Consumer Stub1) Download (and install) the Sun Java Wireless Toolkit
(http://java.sun.com/products/sjwtoolkit/) 2) Run the Stub Generator to create the stub classes you’ll call from your Java
application
26
Generating the Web Services Consumer Stub
27
The Stub Classes
28
DomDirLookup Class// This class was generated by 172 StubGenerator.// Contents subject to change without notice.// @generatedpackage com.johnwargo.domdirlookup;public interface DomDirLookup extends java.rmi.Remote { public java.lang.String[] GETUSERLIST(java.lang.String
SEARCHSTR) throws java.rmi.RemoteException; public com.johnwargo.domdirlookup.USERINFO
GETUSERDETAILS(java.lang.String SEARCHSTR) throws java.rmi.RemoteException;
}
29
Building the BlackBerry Java client1) Create a new Java project2) Import the stub classes3) Write your code
30
Building the BlackBerry Java client
31
Obtaining the Complete Instructions● I wrote a series of documents describing this process at johnwargo.com:
▬ http://www.johnwargo.com/index.php/Domino/dbja1.html ▬ http://www.johnwargo.com/index.php/BlackBerry/dbja2.html ▬ http://www.johnwargo.com/index.php/Miscellaneous/bbdja25.html ▬ http://www.johnwargo.com/index.php/BlackBerry/bbdja3.html
32
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
33
Building a Windows Mobile Client1) Create a new Project2) Add a Web Reference to the project3) Write your code
34
Building a Windows Mobile Client
35
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
36
Building a RESTful Web Service● Some mobile platforms do not support XML-based Web Services directly● You can hand craft the SOAP Request and Response, but that's really
painful● You could use kSOAP (for Java applications) or other open source libraries
to provide the needed support, but that can get ugly (and difficult to support/troubleshoot)
● You can use Representative State Transfer (REST) as a useful alternative to XML-based Web Services
37
About REST● Request Parameters are included in the HTTP request URL● Service results are included in the body of a HTTP response
(using JSON for example - www.json.org) ● Request Examples:
▬ http://servername/dbname.nsf/agentname?openagent&searchstr=war▬ http://servername/dbname.nsf/agentname?openagent&searchstr=john%20wargo
● Response Example:▬ [“Anna Wargo”, “John Wargo”]▬ {“FirstName”:”John”,“LastName”:”Wargo”,“Email”:”[email protected]”,
“OfficePhone”:”123.456.7890”,“MobilePhone”:”987.654.3210”,“HomePhone”:”456.789.1230”}
38
RESTifying the Domino Directory Lookup Service
● Two Options:▬ Split the existing Web Service into two agents▬ Migrate Web Service into a single agent that parses the URL command
line then calls separate functions in the agent● Use the same logic, just a different access method and output format for the
data (JSON for example vs. XML/SOAP)● You could but the logic in a script library then create two wrappers around it
(XML-based Web Service and RESTful Web Service)● Could use the JSONWriter LotusScript classes in your application to output
the JSON (http://preview.tinyurl.com/ykdnmx3)
39
RESTifying the Domino Directory Lookup Service
40
Agenda● Introduction● Deciding: Browser vs. Rich client?● Understanding the power of Domino Web Services for mobile
devices● Building the XML Web Service● Building a BlackBerry client● Building a Windows Mobile client● Building the RESTful Web Service● Wrap-up
41
Wrap-Up● Read the articles on how to build the Domino XML Web Service and
BlackBerry Java Application▬ http://www.johnwargo.com/index.php/Domino/dbja1.html ▬ http://www.johnwargo.com/index.php/BlackBerry/dbja2.html ▬ http://www.johnwargo.com/index.php/Miscellaneous/bbdja25.html ▬ http://www.johnwargo.com/index.php/BlackBerry/bbdja3.html
● Download the sample Domino database from the articles or from http://www.johnwargo.com/files/ls2010-ad114.zip
● Download the sample BlackBerry Java application from the articles or from http://www.johnwargo.com/files/ls2010-ad114-bb.zip
● Download the sample Windows Mobile application from http://www.johnwargo.com/files/ls2010-ad114-winmo.zip
42
Wrap-Up● Be sure to fill out your session evaluations!● Want More? Repeat of BP212: Delivering IBM Lotus Domino to Mobile
Devices: Top 10 Mobile Browser Dev Tricks - and More! (with Rob Wunderlich) at 1:30 PM Today!
43
Questions?
44
Legal Disclaimer© IBM Corporation 2010. All Rights Reserved.The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication 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 this presentation 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 this presentation 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. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International Business Machines Corporation in the United States, other countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both.Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.
Top Related