Skip to main content link. Accesskey S
  • Translate Page ▼
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • Lotus Notes and Domino Application Development wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.0
  • 6.5
  • 8.0
  • 8.5
  • 8.5.1
  • 8.5.2
  • 8.5.3
  • action bar
  • Agents
  • Ajax
  • app dev
  • beginner
  • C&S
  • calendaring and scheduling
  • client
  • composite applications
  • Controls
  • converters
  • css
  • Custom controls
  • Data Binding
  • db2
  • design elements
  • dialog boxes
  • Documents
  • Dojo
  • Domino
  • Domino Designer
  • Domino Designer 8.5
  • DXL
  • Eclipse
  • error handling
  • errors
  • extensions
  • FAQ
  • Forms
  • formulas
  • getting started
  • globalization
  • Help
  • html
  • Installation
  • interface
  • internationalization
  • Java
  • JavaScript
  • JSF
  • localization
  • Lotus Domino Designer
  • LotusScript
  • LotusSphere
  • LotusTechInfo
  • menu bar
  • Mobile
  • new user
  • Notes
  • Notes 8
  • notes.ini
  • NSD
  • OpenNTF
  • partial update
  • performance
  • Pickers
  • Portal
  • presentations
  • programming
  • Redbooks
  • Requested Articles
  • roadmap
  • rooms and resources
  • samples
  • Scripting
  • security
  • tabs
  • templates
  • themes
  • Tips
  • toolbar
  • troubleshooting
  • tutorials
  • validation
  • variables
  • video
  • VideoFest
  • View
  • view control
  • ViewPanel
  • Views
  • web
  • Web apps
  • Web services
  • webdev
  • x-pages
  • XML
  • Xpage
  • XPages
  • XPages Extensibility API
  • XPages Extension Library
  • xsp-config
  • データソース
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > XPage Tutorials > X-Pages iPhone Application Tutorial
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

X-Pages iPhone Application Tutorial 

expanded Abstract
collapsed Abstract
No abstract provided.
ShowTable of Contents
HideTable of Contents
  • 1 Part 1 Size to fit screen
  • 2 Part 2 More formatting
  • 3 Part 3 Make it Look Like a Native App
  • 4 Video Example Application
  • 5 About the Author
This article provides information on how to create an application for an iPhone.  

Part 1 Size to fit screen

A new task has emerged, i need to make an internal crm database accessible to mobile phones. Since the iPhone is supported for Traveler 8.5.1, i decided to focus on this platform and the inherent capabilities it provides.
 

First i had a lot of trouble getting things sized right for the screen, and then there was zooming issues. I finally discovered a way to help format the page correctly and disable zooming.

 

In the source view of the Xpage, go to the top and under the tag enter this tag in

 

   1:   
   2:  
   3:  

<meta name="viewport" content="width=320;

   4:  
   5:  

initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> 

   6:  
   7:  


 
 

It only affects the iPhone Safari and displays in its full size on all other browsers.

Other good news was the iPhone automatically turned the phone numbers into links. I made the email address a “mailto:” link, and that opens an iPhone email very fast without leaving Safari.

 

Tomorrow i will show how i got the iPhone Google maps application to map this address, and also map directions from your current location to the destination address.

And no, its not slow at all, and i don't have 3G.

 

photo photo3


photo5 photo4

 


  

Part 2 More formatting


In my last post i showed how to size the screen and disable zooming, but things were still a little small. In particular the view spacing was not that finger friendly, also it looked a little akward with the page having padding around the table, and the fonts were too small.
 

Here is what is looked like

 

photoold1photoold2

 

To solve the view spacing issue, i added this code to my style sheet to change the height of the rows.

   1:   .xspDataTable tbody tr td {

   2:  border-top:1px solid #E8E8E9;
   3:  
   4:  font-weight:normal;
   5:  
   6:  height:45px;
   7:  
   8:  vertical-align:middle;
   9:  
   10:  }


This changes the line height to 45 pixels(i also changed the font to Arial 14), much more finger friendly than 20px. Here is what it looks like now

 

photo 2photo 4

 

I then took away all the page padding to get a better look, increased font size, and added this script to hide the address bar on load

   1:   addEventListener('load', function() { 

setTimeout(hideAddressBar, 0); 

   2:      }, false); 
   3:  
   4:  function hideAddressBar() { 
   5:  window.scrollTo(0, 1); 
   6:  } 
 

I also created a custom view pager and increased the font size to 14, and made all row heights 45px, here is the result

 

photo 2photo 4 photo 3


Part 3 Make it Look Like a Native App

The first thing you need to do to make your Xpage application look like a native iPhone app is to put all the parts(view, form, etc.) into 1 Xpage.  I did this with two panels, one is hidden while the other is showing.  In the first panel, which is set to display:none by default, is the contact form.  The other panel which is visible by default is the view and search function.

 

Configure the links in the view to set the document(data source for the contact panel) to the universal docid  by using the columns onClick event on the events tab. Set it to partial update the contact panel to receive the information from the document data source. On the client side js in the onClick event, set the panel with the search view in it to display:none, then set the contact panel to display:block.

dde1

 

Then create a back button on the contact form that hides the contact panel, and displays the search view panel.

 

The reason you need to put everything on one page and use Ajax refresh is because of the next step, also it is much much faster then changing pages.  Add this meta tag to the Xpage.

 

When a user bookmarks a your web page with this meta tag on the iPhone home screen, it will open in its own safari app process, it will not show the location bar or the bottom nav bar.  If you click on a link to another web page it will open it in a normal Safari window and take you away from the app, ruining your appearance of it being a native app.

 

Another meta tag that really makes a difference is:

 

photo6 photo7 

 

This will set the top bar with “ATT and time” to be black when the app is opened.   

Now we want a custom icon on the iPhone home page, and a startup image too.  For this we add two links:

/icon.png” /> 
/startup.png" />

 

Notice the CRM app icon on the desktop, then look at the startup “splash screen” image.

 

photo photo 4

 

The start up image comes up immediately, then waits for your page to open.  I suggest making your own Domcfg.nsf login form using the ultralite login subform as a start, then make the buttons and fields allot bigger.  i also found out that sometimes this replaces the iPhone home icon with the ultralight login image, so fix that as well, every app will have to have a custom login form.  I also added the ability to remember the password, not just the username.  You can search the web to find the correct dimensions for these pictures.

 

login

 

All that is left is to put in some nice webkit transitions when you hide and then display the panels.  I like to first fade out the current panel, after the fade out has occurred - set it to display:none, Set the next panel to display:block, then fade that panel in.  Most of this can be done with CSS, i will blog on this later.  You can also do the card flip or any webkit transition you would like.

 

photo photo 4 login photo6

 
 

Video Example Application

Here is an Example of what you can end up with following these steps 
 

  
 Get ITANA Here!
 

About the Author

 

Author:  Mark Hughes

Blog:  My Blog
Check out  your Lotus Notes ToDo's and Journal on the iPhone at Hughesconnect.com 
 
 


expanded Article information
collapsed Article information
Category:
XPage Tutorials
Tags:
iPhone, Xpage, X-Pages, ToDo, Journal, tutorials

This Version: Version 21 February 23, 2010 4:49:53 PM by Mark T Hughes  
   
expanded Attachments (0)
collapsed Attachments (0)

 


expanded Versions (21)
collapsed Versions (21)
expanded Version Comparison
collapsed Version Comparison
     
Version Date Changed by               Summary of changes
This version (21) Feb 23, 2010 4:49:53 PM Mark T Hughes  
20 Feb 23, 2010 4:39:02 PM Amanda J Bauman  
19 Feb 23, 2010 4:37:31 PM Amanda J Bauman  
18 Feb 23, 2010 4:36:30 PM Amanda J Bauman  
17 Feb 23, 2010 4:35:30 PM Amanda J Bauman  
16 Feb 23, 2010 4:33:41 PM Amanda J Bauman  
15 Feb 23, 2010 4:31:18 PM Amanda J Bauman  
14 Feb 23, 2010 4:30:10 PM Amanda J Bauman  
13 Feb 23, 2010 4:18:09 PM Mark T Hughes  
12 Feb 23, 2010 4:13:16 PM Mark T Hughes  
11 Feb 23, 2010 4:10:46 PM Mark T Hughes  
10 Feb 23, 2010 4:09:34 PM Mark T Hughes  
9 Feb 23, 2010 4:06:30 PM Mark T Hughes  
8 Feb 23, 2010 4:04:09 PM Mark T Hughes  
7 Feb 23, 2010 4:02:57 PM Mark T Hughes  
6 Feb 23, 2010 4:02:24 PM Mark T Hughes  
5 Feb 23, 2010 4:00:46 PM Mark T Hughes  
4 Feb 23, 2010 3:59:12 PM Mark T Hughes  
3 Feb 23, 2010 3:55:48 PM Mark T Hughes  
2 Feb 23, 2010 3:55:10 PM Mark T Hughes  
1 Feb 23, 2010 3:49:42 PM Amanda J Bauman  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Tip: When linking to articles use the original title, not the edited title. The alias for the link can be the edited title.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • Lotus Technical Information and Education Team Blog
  • Lotus Tech Info on Twitter
  • Lotus Tech Info on Facebook
  • Lotus product forums
  • Lotus Tech Info blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use
Return to English
Arabic
Chinese Simplified
Chinese Traditional
French
German
Italian
Japanese
Korean
Portuguese
Russian
Spanish