Motorola C370, C550, C450 technical manual Java System, MIDlet Control of MIDlet State Transitions

Page 29

5

Application Management

MIDlet Control of MIDlet State Transitions

MIDlets have a lot of flexibility to control their own state. A MIDlet can call its own startApp(), pauseApp(), and destroyApp() methods, however those are the methods that the AMS uses to indicate a state transition to the MIDlet. The MIDlet can call those methods if it wishes to perform the work that it would typically do during that state transition.

Other sets of methods the MIDlet can use to cause state transitions are

resumeRequest(), notifyPaused(), and notifyDestroyed(). Since the system user interface has priority, a MIDlet cannot force itself into the active state, but it can request that it be resumed via a resumeRequest(). If the system is not busy, it will automatically grant the request. However, if the device is not in the idle screen, then it displays an alert dialog to the user to resume or end the MIDlet. If the user denies the request, the MIDlet is not notified, however if the user grants the request, the MIDlet’s startApp() method is called, and it gains focus when that finishes.

The MIDlet has more control when it decides it wants to be paused or destroyed. The MIDlet performs the necessary work by calling its own pauseApp() or destroyApp() method, then notifies the AMS of its intentions by calling notifyPaused() and notifyDestroyed() appropriately. Once notified, the AMS transition the MIDlet’s state and revoke focus.

Java System

The Java Settings Menu allows management of MIDlet suites, as well as system maintainance. The Java System feature gives statistics about the system such as:

CLDC Version

MIDP Version

Data Space and Program Space (Free space)

Total Heap Size

The figure below depicts the Java System Menu.

29

Image 29
Contents Technical Manual Table of Contents Lcdui JAD Attributes Purpose IntroductionAudience DisclaimerReferences Definitions, Abbreviations, Acronyms Revision HistoryDate Name Reason Acronym DescriptionDocument Overview Introduction Java 2 Platform, Micro Edition J2ME J2ME IntroductionResources Available Motorola J2ME PlatformNetworking Description DisplayFile & RMS Java VMIntroduction to Development Developing and Packaging J2ME ApplicationsGuide to Development in J2ME Page Downloading Applications OTA ProcedureInstallation Program and Data space notes Exiting Applications Java Application Installer/De-Installer JaidStarting Applications Downloading MIDlets Error ChecksLaunching Web Session for Http Download XML Screen Renderings BombMan is back, now on your Taichi series of handsets Taichi handset New Games MIDlet Lifecycle Application ManagementMIDlet Suite Installation MIDlet Suite De-installation DestroyApp MIDlet Suite UpdatingCaller Purpose MethodStartApp or the pauseApp Using startApp MIDlet Control of MIDlet State Transitions Java SystemPage Network Connections Network APIClass Descriptions URL Format IOException when it detects a time-out conditionImplementation Notes TCP SocketsUDP Sockets Network API Description LcduiLcdui Class Hierarchy Gaming API and SoundFunctional Description BackgroundMusic Class Using BackgroundMusicBackgroundMusic Methods Gaming API containing a sound APIGameScreen Fields GameScreen ClassPublic int getKeyStates GameScreen MethodsInformation, disabling key events can improve performance GameScreen Using GameScreenImageUtil Methods ImageUtil ClassImageUtil Fields RgbData Using ImageUtilPalleteImage Methods PalleteImage ClassPalleteImage Constructor Public void setTransparentIndexint index throws Using PalleteImagePlayField Class Using Static and Animated TilesPlayField Constructor Using SpritesDefining View Windows 2N+1 2N + Public void addSpriteSprite s throws PlayField MethodsPage Public boolean collidesWithAnyTileSprite s throws PlayField Using PlayFieldSoundEffect Class Using SoundEffectSprite Class SoundEffect MethodsSprite Constructor Animation FramesSprite Drawing Sprite Methods Page Public final void drawGraphics g throws Sprites Using SpriteFileFormatNotSupportedException Max Midi Extension Support Java Gaming Sound APIFileFormatNotSupportedException Constructors Java Gaming Sound APIVibe and Backlight API Vibe and BacklightCreating a Message OverviewPermissions Sending a MessageJAD Attributes JAD AttributesMandatory attributes for manifest files MIDlet-Name Class Description Record Management SystemCode Examples RecordStoreCaveats TipsPhonebook Access API Phonebook AccessSample of code to create object of PhoneBookRecord class Phonebook Access API PermissionsSimmemory Sample of code for calling of ‘getMaxEmailLength ’ method Sample of code for calling of ‘isPrimaryint speedNo’ method Sample of code for calling of ‘getNumberCategories’ method Sample of code for calling of ‘setCategoryView’ method Sample of code for calling of ‘getUsedRecords’ method Int index = ReceivedRecord.getRecord1 Intelligent Keypad Text Entry API ITAPKey Mapping for the C370, C450, and C550 Appendix a Key MappingCenter Select END Available Memory Appendix B Memory Management CalculationAppendix C Online FAQC370, C450, and C550 Spec Sheets Appendix D Spec SheetsReferences Purchase Motorola Developer Information ToolsDocumentation Motorola Developer Information Tools Motorola, Inc
Related manuals
Manual 110 pages 1.04 Kb