|
|
|
|
|
|
|
|
|
|
|
|
|
|
Beginners guide to developing wireless applications (continued)
<HDML VERSION="3.0" TTL="0" PUBLIC="TRUE">
<DISPLAY>
<CENTER>Wireless Test Page
Congratulations, you have successfully made a wireless page!
</DISPLAY>
</HDML>
|
Step 3
Type in the URL on your phone browser or simulator and view the page. The URL would be something like http://servername/sample.hdml. You should see something similar to Figure C.
FIGURE C
 
The sample page is simple, but it's the start of a new area of development for you. Roll over picture for a larger image.
A simple agent to redirect users If you want to redirect people who hit your main Web site URL to either an HTML page or an HDML page, depending on if they're accessing your page via a Web browser or a wireless phone, I've got a simple agent you can use. It's one I've used on a major Web site, and it has run fine with no appreciable impact on the server as far as I can tell. Here's the code:
Sub Initialize
Dim session As New NotesSession
Dim doc As NotesDocument
Set doc = session.DocumentContext
browserType$ = LeftChar ( doc.HTTP_USER_AGENT(0), "/" )
If ( browserType$ = "UP.Browser" ) Then
Print "[http://sitename/home.hdml]"
Else
Print ""
End If
End Sub
Here is the LeftChar function code:
Function LeftChar (Byval Text As String, Delim As String) As String
%REM
Returns the part of the string to the left of the delimiting character(s),
which is searched for from the left of the string. If the delimiter is not
found or no delimiter was provided, the entire string is returned.
%END REM
length = Len(text)
delimlength = Len(Delim)
If delimlength = 0 Then
LeftChar = text
Exit Function
End If
character = Mid$(text, length, 1)
%REM
Search the string character to determine the position of the delimiter.
If the position is greater than 0 return the portion of the string to the left of the delimiter. Otherwise, return the entire string.
%END REM
checkpos = 1
pos = Instr(checkpos, text, delim)
If pos > 0 Then
pos = pos - 1
LeftChar = Left$(text, pos)
Else
LeftChar = text
End If
End Function
|
Now all you need to do is change the home page URL on the Domino server to open this agent when someone types in the main URL for your server. Be sure and put a leading "/" before any subdirectory or else Domino will show the full URL when you hit the server rather than showing just the base site URL. Also, as you can see in the sample redirection agent above, I've used an absolute URL to specify where a phone user should be directed. Phone.com recommends using absolute rather than relative URLs when redirecting phone users.
Conclusion It's going to be a wireless world, but it's going to take a while. There will need to be more killer applications out there before we reach a critical mass of wireless phone users. This is where we Domino developers come into play. This is an excellent chance to get in on the ground floor of a new technology, and there aren't that many great chances to do that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|