|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.nttdocomo.ui.Frame
|
+--com.nttdocomo.ui.Canvas
|
+--HtmlCanvas
The PicoBrower is a tiny HTML browser for the NTT DoCoMo Java iAppli phones.
It is designed to support display and browsing of documents containing a minimal subset of HTML.
The purpose of this module is not so much general web browsing, which can be done using the microbrowser in the phones, but rather the ability to display documents within a Java IApplication.
The problem is that the NTT platform framework has no integration between the phone's microbrowser and it's Java VM, so there appears to be no easy way to give your Java applet the ability to display HTML output.
HTML documents are a wonderful way to display information to users, and to provide interaction, via clicking on hyperlinks or submitting forms. Ideally the Java application could call out to display HTML on the phone's microbrowser, and the phone could submit data back to the application. In essence, the application would be a servlet engine. The NTT platform API designers have not yet taken this useful step, however. So the current design dicates that if we want HTML browsing capability from out application, that we write a browser in Java.
Unfortunately, the current size limit of 10kbytes for an IApplication force the PicoBrowser to have a very bare-bones set of capabilities.
The PicoBrower supports the following HTML tags. Note that there are some restrictions on the syntax, as document below. Note also that we are aiming at compatibility with XHTML BASIC (the subset of XHTML proposed for mobile devices) at some point in the future. But you don't need to close your P tags.
| Element Tag | Action |
|---|---|
| BR | Linebreak |
| P | Paragraph break |
| B, STRONG | Bold font |
| A HREF="URL" | A hyperlink. The URL value must
be enclosed within double quotes. The URL may be an absolute URL,
such as "http://www.foo.com/bar.html", or it may be a relative URL,
such as "foo.html". Relative URLs will be resolved with respect to
the current document's base URL.
The HREF value may also be a local application resource, such as "resource:///foo.gif". Because the code for deducing the base URL is quite stupid, if you want to use relative URLs within your HTML document, you must specify the target URL of the page as a full path and filename, such as "http://foo.com/index.html". This is because the algorithm used to compute the base URL is simply to find the last '/' in the target URL and to strip off everything after it. |
| PRE | Preformat text region. Whitespace is preserved, and fixed width font is used. |
| FONT COLOR="#rrggbb" | You may specify a font color, using the hex RGB values. Double quotes are required around the value. |
| IMG SRC="URL" | An inline image. The URL value must be contained in double quotes. URL may be a absolute or relative URL. You may also refer to a local resource of the form "resource:///foo.gif". |
| CENTER | Display text centered on the screen |
| I, EM | Italic font. Bold-Italic may be specified by nesting the I and B tags, like <B><I>This is bold italic</I></B>. |
| Entities | Supported entities: &, < > " &#ddd; &NBSP; |
The PicoBrowser does not support forms embedded in HTML documents.
Key Bindings
The PicoBrowser application has the following key bindings:
| UP, DOWN | Prev, Next page/hyperlink |
| LEFT | Back (previous URL) |
| SELECT | Fetch selected hyperlink |
| RIGHT | unused |
| SOFT1 | Scroll to prev page |
| SOFT2 | Scroll to next page |
| 1 | Smooth Scroll down |
| 2 | Home (fetches resource:///index.html) |
| 3 | Smooth Scroll up |
| * | Enter New URL from keyboard |
| # | Exit Application |
| Fields inherited from class com.nttdocomo.ui.Frame |
a, b, c, d, f, g, h, i, j, k, l, SOFT_KEY_1, SOFT_KEY_2, SOFT_KEY_3 |
| Fields inherited from interface com.nttdocomo.ui.ComponentListener |
BUTTON_PRESSED, SELECTION_CHANGED, TEXT_CHANGED |
| Constructor Summary | |
HtmlCanvas()
|
|
| Method Summary | |
void |
componentAction(com.nttdocomo.ui.Component source,
int type,
int param)
|
void |
keyPressed(com.nttdocomo.ui.Panel p,
int key)
|
void |
keyReleased(com.nttdocomo.ui.Panel p,
int key)
|
void |
paint(com.nttdocomo.ui.Graphics g)
Redisplay the current page. |
void |
processEvent(int nType,
int nParm)
Handle a keypad event |
void |
setText(java.lang.String text)
Set the HTML text of the current page. |
void |
setURL(java.lang.String url)
Tell browser to load data from URL. |
void |
softKeyPressed(int key)
|
void |
softKeyReleased(int key)
|
| Methods inherited from class com.nttdocomo.ui.Canvas |
a, getGraphics, getKeypadState, repaint, repaint |
| Methods inherited from class com.nttdocomo.ui.Frame |
a, a, b, f, getHeight, getWidth, setBackground, setSoftLabel |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HtmlCanvas()
| Method Detail |
public void setURL(java.lang.String url)
public void setText(java.lang.String text)
public void paint(com.nttdocomo.ui.Graphics g)
paint in class com.nttdocomo.ui.Canvas
public void processEvent(int nType,
int nParm)
processEvent in class com.nttdocomo.ui.Canvaspublic void softKeyPressed(int key)
softKeyPressed in interface com.nttdocomo.ui.SoftKeyListenerpublic void softKeyReleased(int key)
softKeyReleased in interface com.nttdocomo.ui.SoftKeyListener
public void keyPressed(com.nttdocomo.ui.Panel p,
int key)
keyPressed in interface com.nttdocomo.ui.KeyListener
public void keyReleased(com.nttdocomo.ui.Panel p,
int key)
keyReleased in interface com.nttdocomo.ui.KeyListener
public void componentAction(com.nttdocomo.ui.Component source,
int type,
int param)
componentAction in interface com.nttdocomo.ui.ComponentListener
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||