Motorola i88s manual Caveats

Page 28

Motorola Inc.

i88s J2ME Developers’ Guide

If a MIDlet suite is updated to another version, then the file(s) associated with the current version of MIDlet suite, can be maintained for the new version to use. The user is prompted to keep the old data or delete it.

If the MIDlet suite is deleted, all files associated with it are deleted.

It is the MIDlets responsibility to coordinate the use of multiple threads to access a file since unintended consequences may result.

Whenever you close a file, the close command will not return until all the pending writes have been completed; thus closing a file guarantees that all of the data was written. It is then safe to power off the device. One consequence is that the close command may take a while to return. Therefore, if you open and close the file every time a write is required, performance will be greatly affected.

3.6Caveats

This File Access System is a sequential system. This means once you write particular chunk of data to the file you can’t go back and manipulate it.

The maximum number of files that the i88s phone supports is 1024. Once the phone contains 1024 files, it will not be able to create more. MIDI ringers, voice notes, wallpapers, PNG images included with a MIDlet etc. are all files. If a MIDlet is to have many images, such as sprites used in animations, it may be advantageous to have them all in one image file and use clipping to display only what you need.

A file can be of any size as long as file space is available. A zero byte file is also allowed.

It is recommended that only 15 files remain open at one time. Exceeding the maximum number of opened files can result in unintended behavior.

The InputStream method markSupported() method returns true only if the file open mode is READ or APPEND. This means that in any other file open mode, the mark() and reset() methods do not work.

In the InputStream method mark(), the readlimit argument tells the input stream to allow that many bytes to be read before the mark position gets invalidated. Since this operation is on a file, “remembering” the entire contents of stream/file does not incur any type of cost, so the readlimit parameter is ignored preventing mark position invalidation.

Version 1.0 - Page 28

Image 28
Contents I88s Multi-Communication Device J2ME Developers’ Guide J2ME Networking Document Overview DisclaimerAcronyms and Definitions Contact InformationAcronyms Used In This Guide Terminology Definition Agps On The i88s Phone OverviewAccuracy Position APIAssist Data Almanac Out Of Date PositionConnection ClassExample Method Descriptions Retrieving Position in JavaGetPosition GetPositionString nameUsing Position in Java GetStatusExample Using PositionConnection Positionresponsenoalmanacoverride Addition, to obtain better accurate speed and direction Recommendation J2ME Networking Http HttpsClass Descriptions Https HttpSupported Protocols on the i88s Phone SSL Secure Sockets TCP SocketsServerSockets Serial Port Access UDP SocketsConnection Optional Parameters Communicating on a PortExample using StreamConnection Implementation NotesTips Concurrent Connections For The i88s Phone Protocol MaximumClass Description File I/OMethod Descriptions Opening a file Reading and Writing Deleting a fileCode Examples Example # 2 Complete MIDlet code Motorola Inc I88s J2ME Developers’ Guide Os = sc.openOutputStream //get InputStream Sc.close Caveats Motorola Inc I88s J2ME Developers’ Guide
Related manuals
Manual 43 pages 17.94 Kb