
|
With the new Sony Ericsson Java Developing standby application MIDlets: considerations There are two major issues that the developer must consider. The first issue is speed or more accurate screen frame rate. When the standby application starts, it runs in the background, and is assigned a low priority by the application manager. This means that the expected frame rate is considerably slower than for normal MIDlets, which means that for example 3D rendering is not well suited for standby MIDlets. Furthermore, the application needs to be quick off the mark. It has only 4-5 seconds to do something useful and show this to the user before the phone hibernates and enters energy saving mode. The other issue is interaction. The application does not have focus when it runs in the background. This means that the end-user can't interface with the MIDlet during this state. The application can be activated however (see below), but this requires user interaction. Since the application can't receive end-user input while in the background, standby MIDlets that use restricted application programming interfaces should be signed to avoid user interaction while the MIDlet is running in the background.
Figure 1 shows the different states of a standby application. When the phone enters the Standby screen, the application is started (if not already running), and starts to execute in Inactive mode. The end-user can see what is drawn but cannot interact with the application. However, the application can be activated by Resuming it (just like resuming a minimized application). It then executes like an ordinary application. Minimizing the application makes it go back to Inactive mode again. The application is terminated either by ending it when in active mode, or by setting another wallpaper. Assigning an application as standby Setting an application as wallpaper just involves a few basic steps. 1) Selecting Wallpaper from Display in the Settings menu. You can also select an application as wallpaper application in the normal application list.
Fig 2: assigning a MIDlet as standby/wallpaper
First, to enable the MIDlet to run as a standby application we need to include and set a jad file property: This sample application uses JSR 75 to load jpeg files from the camera album on the JP-7 phone. To check if the phone supports JSR 75 the following piece of code is useful: try { private static String m_memoryStickPhotoPath = "file:///e:/DCIM/100MSDCF/"; When the application is running on the emulator, the following path can be used to access a simulated filesystem. private static String m_emulatorPhotoPath = "file:///root1/"; This path is actually pointing to the folder for the currently selected emulated device: PC_Emulation\WTK2\appdb\SonyEricsson_W850_Emu\filesystem\root1 It is also possible to check if the application is running on the emulator using the following method: public static boolean isEmulator () { startApp, pauseApp, resumeApp and destroyApp public void startApp () { The expected frame rate for an application running in standby is considerable slower than for normal MIDlets, which means that for example 3D rendering is not well suited for standby MIDlets. Producer/Consumer This standby MIDlet is good example of a producer/consumer problem. First the application needs to produce images, i.e. load and process jpeg files, then consume them and present the production result to the end-user, i.e. animate and display them on the screen. This can be solved by using two synchronized threads where the main animation thread waits for images to be produced by an image producer. // PRODUCER Standby and user-interaction The application does not have focus when it runs in the background. This means that the user can't interface the MIDlet during this state. Added commands will not be visible until the application has focus. The application has focus when it is running as a normal MIDlet. The screenshots below illustrates the two different modes. The left screenshot shows the MIDlet running in the background with user-interaction disabled, and, consequently on the right we have the added commands About and Clear as soft keys.
Download example standby MIDlet source code and images>> More information: |
Copyright © 2001 - 2009 Sony Ericsson Mobile Communications AB. All Rights Reserved.