Sometimes mobile users need more than a browser version of a Lotus Domino application. When remote workers need to access Lotus Domino application data when out of network coverage, or when the data must be easily manipulated on-device, the browser just doesn't cut it -- enter Mobile Rich Client Applications. In this session, we'll present an overview of rich client application options for Lotus Domino and build several applications right before your very eyes!
2024: Domino Containers - The Next Step. News from the Domino Container commu...
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM Lotus Domino
1. Beyond the Mobile Browser – Building Rich
Mobile Applications for IBM Lotus® Domino®
John M. Wargo | Director, Industry Solutions Practice
AT&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
2
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.com
Twitter: @johnwargo
4
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
5
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?
6
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
7
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
8
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
9
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?
10
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
11
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
12
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
13
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
15
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
16
18. SOAP Message Format
To consume from a Java application, the Web service must use Doc/Literal
SOAP message format
18
19. The Code: Defining Variables
'Some Notes objects we'll need
Dim db As NotesDatabase
Dim s As NotesSession
19
20. The Code: Two Classes
'The following class defines an array of strings
'that will be returned by the function GetUserList
Class UserList
Public users() As String
End Class
'the following class defines the user details
'that we will be returning for a detailed lookup
Class UserInfo
Public FirstName As String
Public LastName As String
Public FullName As String
Public EmailAddress As String
Public OfficePhone As String
Public MobilePhone As String
End Class
20
21. The Code: Defining the Main Class
Class 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 Function
End Class
21
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
23
24. Building a BlackBerry Java Client
1) Generate the web services stub classes
2) Create a new BlackBerry Java project
3) Import the stub classes
4) Write your code
24
25. Generating the Web Services Consumer Stub
1) 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
25
28. DomDirLookup Class
// This class was generated by 172 StubGenerator.
// Contents subject to change without notice.
// @generated
package 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;
}
28
29. Building the BlackBerry Java client
1) Create a new Java project
2) Import the stub classes
3) Write your code
29
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
31
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
32
33. Building a Windows Mobile Client
1) Create a new Project
2) Add a Web Reference to the project
3) Write your code
33
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
35
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
36
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”:”jwargo@somedomain.com”,
“OfficePhone”:”123.456.7890”,“MobilePhone”:”987.654.3210”,
“HomePhone”:”456.789.1230”}
37
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)
38
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
40
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
41
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!
42