×
Namespaces

Variants
Actions

Retrieving the icon of a MIDlet using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia N96, Nokia N95, Nokia E71
CompatibilityArticle
Created: User:Technical writer 1 (13 Jan 2009)
Last edited: hamishwillee (09 Aug 2013)

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:

This page was last modified on 9 August 2013, at 07:32.
71 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×