×
Namespaces

Variants
Actions
Revision as of 16:08, 13 January 2009 by Forum Nokia KB (Talk | contribs)

Retrieving the icon of a MIDlet using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search


Template:KBTS

Article Metadata
Tested with
Devices(s): Nokia N96, Nokia N95, Nokia E71
Compatibility
Platform(s): S60 3rd Edition FP1, S60 3rd Edition FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
Article
Keywords: RApaLsSession, TApaAppInfo, MAknsSkinInstance, AknsUtils
Created: (13 Jan 2009)
Last edited: Forum Nokia KB (13 Jan 2009)

Overview

This article explains how to retrieve the icon of an installed Java MIDlet.

Description

According to the MIDP 2.0 specification, the icon of a MIDlet must be included inside the JAR only, for example regarding the MIDlet-<n> attribute used in the JAD file. "Icon is the case-sensitive absolute path name of an image (PNG) within the JAR for the icon of the nth MIDlet."

Because the icon is included inside the JAR file, there is no way to get the icon information from the file, but MAknsSkinInstance can be used to get the MIDlet icon from the S60 menu.

Solution

 RApaLsSession iApaSession;
TApaAppInfo appInfo;
iApaSession.GetAllApps();
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
for(TInt i= 0; i < iAppCount; i++)
{
iApaSession.GetNextApp(appInfo);
//Filtering through the list to get Midlets from the list of applications
if(appInfo.iFullName.Right(8).Compare(_L(".fakeapp"))==0)
{
appInfo.iFullName; //Gives Name of the Midlet
appInfo.iUid; //Gives Uid of the Midlet
TRAPD(Err,
CFbsBitmap* midletIcon, midletIconMsk;
AknsUtils::CreateAppIconLC(skin,
appInfo.iUid,EAknsAppIconTypeList,
midletIcon,
midletIconMsk);
 
// midletIcon and midletIConMsk has the Icon and Mask respectively.
(Print them to see the icon)
);
}
}

Related article:

78 page views in the last 30 days.
×