To enter text in a biNu app the system uses the native text entry capability of the phone. This interface differs between different manufacturers but it is a ‘look and feel’ already familiar to the user and is configured to their own environment and preferences. Developers do not need to program the phone to use its text entry capabilities, they just need to generate a simple XML page and biNu converts this into instructions to the phone.
Due to the standard limitation of most phones, text entry needs to be a distinct step. It cannot be seamlessly integrated into an application but must occur on a specific screen dedicated for that task. Developers have little control over the behaviour of the screen or display. They cannot include the display of relevant information that would help the user or place the text entry in context.
A number of fields can be displayed on the same screen and the user can navigate between them using standard navigation keys (exact navigation control is device dependent). The developer has some control over each field and is able to define in the field tag:
- the boilerplate text displayed against each field (i.e. the field name)
- an initial default value for the field
- whether a field is mandatory and its maximum length
- whether the characters entered are hidden (e.g. for passwords)
- whether the field entry area should occupy the whole screen
Any complex validation of the data entered must be performed by the app itself.
A title can be displayed on the top of the Text Entry screen. This is defined as an attribute of the
tag in the biNu XML markup.
Processing Data In The App
When the user presses the Select (usually the middle key just underneath the handset screen) the values entered into all the fields on the text entry page are submitted to the app. They are appended to the URL defined for the Select key. For example:
URLs Of Text Entry Pages
If fields of a text entry page are displayed with an initial default value, it is recommended that the values should be included in the URL of the page. This will ensure that biNu will not incorrectly cache the page.
Sending Special Characters
Any special characters that are entered that cannot appear on a URL are % encoded to their hex value. For example:
The Navigate key is always programmed to exit the text entry screen and return to the previous screen without saving any changes. The Action key must be programmed by the developer and usually represents "submit" or "ok" to the user. biNu will always append the field values to the URL associated with this key. It is common for the Select key to be programmed to exit the application and return to the “home” screen.
The numeric keys on the handset cannot be re-programmed because they are used to enter text into the fields. Text can only be entered in the languages supported by the phone. Most keys cannot be mapped. The Navigation key will always go back. The softkeys will usually have a label above which are defaults to the phone and may say "Back", "Ok", "Submit" etc.
Native Text allows large blocks of text to be sent to the client with minimal processing by the proxy. It is intended for long passages of text that contain no real formatting. All the text must be in the same font and colour. With the exception of line and paragraph breaks there is no ability to split the text, force indentation etc. Any breaks in the text, for headers, bullet points or complex layout structures should be defined using normal biNu XML positioned before each block of Native text.
The native text will be rendered using the limited number of font available on the mobile phone.
The native text will normally have a unrestrained display height and the height of the text block will vary depending on the handset fonts, screen size etc.
There are some restrictions on the use of Native Text:
- It can only be used in a panning or listing areas which are using ClientScrolling.
- In panning areas it should be placed inside a Div area. It must be the last item in the Div. A Div is not required if there is only one Native Text block in a panning area providing it is the last item in that area
- It can be used in a listing provided the listing is of type ‘complex’. There is a maximum of one Native Text per row.
- Only ASCII text is supported.
- It cannot be used with Push Update
Native Text should be used for larger blocks of text, typically longer than 2-3 lines. For shorter text there is better performance using normal biNu XML Text.
The NativeText must use a <nativeStyle>. NativeStyles have different attributes to normal styles, for example you cannot specify a font height tou can only specify whether it is small, medium or large.
Example in a panning area:
</style> <nativeStyle name="native1"> <color value="#00000000"/> </nativeStyle> </styles> ... <pageSegment> <panning vScrollStep="client" hscroll="none" vscroll="none"> <div> <text x="15" y="10" w="-5" mode="wrap" style="body"> This is normal text </text> <nativeText x="15" y="120" w="-5" mode="wrap" style="body"> This is native text </nativeText> </div> </panning> </pageSegment>
Example in a Listing Area
</style> <nativeStyle name="native1"> <color value="#00000000"/> </nativeStyle> </styles> ... <pageSegment x="0" y="72" h="-16"> <listing listName="applications" type="complex" vScrollStep="CLIENT" vscroll="none"> <link name="url" x="22" y="4" w="20" h="20" mode="truncate" style="body"/> <field name="text" x="40" y="4" w="-10" mode="truncate" style="native1"/> </listing> </pageSegment>
Note: There is no special element for NativeText within a Listing definition. Three requirements have been met:
- the listing is of type ‘complex’
- the scrolling of the listing is performed on the client ( vScrollStep=”CLIENT” )
- the style ‘native1′, referenced in the field element is type <nativeStyle>
It is now possible to continue text from the end of the previous block of text. Simply define a text element with no x/y or size attributes. This can be used to change styles part way through a line.
<pageSegment> <fixed> <text x="0" y="45" mode="wrap" style="label"> First bit of Text. </text> <text mode="wrap" style="body"> Second bit of Text in new style </text> </fixed> </pageSegment>