February 5th, 2006

Making full-screen Symbian C++ applications

There are different methods for making full-screen applications.

1. Cover the system panes
This simple method is used when the application has a traditional view architecture where the view is not a full-screen view. To make the view full screen, call the CCoeControl::SetExtentToWholeScreen() method in the MyView::ConstructL method before the ActivateL() call.

void CHelloWorldPlusAppView::ConstructL(const TRect& aRect)

{

// Create a window for this application view

CreateWindowL();

// Set the window size

SetRect(aRect);

// This view is a full-screen view.

SetExtentToWholeScreen();

// Activate the window, which makes it ready to be drawn

ActivateL();

}

SetExtentToWholeScreen() is not recommended when the application is skinned (from S60 2nd Edition onwards; see figure). However, full-screen applications do not want the skin feature anyway, so this should not be a problem.

2. Hiding
The status pane and softkeys can be hidden. The status pane can be hidden from the AppUi with the command

#include <eikbtgpc .h>
#include <avkon .rsg>
StatusPane()->MakeVisible(EFalse);

Softkeys can be hidden from the AppUi with the
Cba()->MakeVisible(EFalse); command, which activates the “null” softkeys. The default softkeys have no effect after that. To activate the default option menu and the Back key immediately after the keys are pressed, manually handle the key presses. This can be done in the HandleKeyEventL() method as follows:

TKeyResponse CHelloWorldPlusAppUi::HandleKeyEventL( const TKeyEvent& aKeyEvent,TEventCode TEventCode aType)
{

// Left or right softkey pressed
if (aType==EEventKeyDown && (aKeyEvent.iScanCode == EStdKeyDevice0 || aKeyEvent.iScanCode == EStdKeyDevice1))
{
Cba()->MakeVisible(ETrue);
}
else
{
Cba()->MakeVisible(EFalse);
}
}

return EKeyWasNotConsumed;

}

After that, you can use whole screen when drawing.

February 5th, 2006

Way to localize roots and common directories in Series 60 FileConnection API

Additional way to localize roots and common directories in Series 60 FileConnection API implementations: Virtual File System (VFS)
S60 devices have an additional way to localize roots and common directories in addition to the system properties: the Virtual File System. The VFS is, however, not implemented in Series 40 devices.

Virtual root directories (VFS) provide another choice to get direct access to common directories, for example, the “Images” virtual root directory maps to the “Nokia\Images” directory in S60 devices.

Also system properties can be used for accessing common directories, for example, the system property “fileconn.dir.photos” returns in Series 40 devices file:///c:/predefgallery/predefphotos/.

The FileConnection.list() operation returns virtual root directories if connections have been established using virtual root.

February 5th, 2006

Additional JAD attribute for changing Canvas updating feature on Nokia series 40

There is an additional feature for updating Canvas for Nokia Series 40 3rd Edition
. It is possible to have the device’s background image also on the MIDlet’s background. An additional JAR attribute is needed for taking this feature into use.
A MIDlet can have the device’s background image on its background as well. This can be done by using the JAD attribute “Nokia-UI-Enhancement” and give the value “CanvasHasBackground” to it. This affects only Canvas that is not in full screen mode but not full-screen Canvas, GameCanvas, or CustomItems.

… in .jad file
***
Nokia-UI-Enhancement: CanvasHasBackground
MicroEdition-Configuration: CLDC-1.0
***

So, add the line “Nokia-UI-Enhancement: CanvasHasBackground” to the MIDlet’s JAD file to take the device’s background image to use in the MIDlet.

MicroEdition-Profile: MIDP-2.0