Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
dst17
Posts: 14
Registered: ‎11-02-2009
My Device: 9500 Storm

Filter the list of applications

Hi,

 

I'm trying to list all the applications installed on the device (Storm on OS 5.0).

I'm using the following code :

 

int[] handles = CodeModuleManager.getModuleHandles(false);
for(int i = 0; i < handles.length; i++) {
int moduleHandle = handles[i];
if(!CodeModuleManager.isLibrary(moduleHandle) && ((CodeModuleManager.getModuleFlags(moduleHandle) & CodeModuleManager.MODULE_FLAG_DELETE) == 0)) {
ApplicationDescriptor[] descriptors = CodeModuleManager.getApplicationDescriptors(handles[i]);
if(descriptors != null) {
for(int j = 0; j < descriptors.length; j++) {
ApplicationDescriptor applicationDescriptor = descriptors[j];
if(applicationDescriptor != null) {
String vendor = CodeModuleManager.getModuleVendor(moduleHandle);
if(vendor != null) {
applications.addElement(applicationDescriptor);
}
}
}
}
}
}

 

 

With this code, I get all the application descriptors from all the modules installed on the device. The problem is that some of the applications are not real applications (I mean an application wich a user can launch from the device).

I can't find a way to filter the results. I'd like to have the lists of apps that we can find in the Options > Applications : "Core", "Add-on" and "Third-party" applications. This is easy to get only the "Third-party" apps but I have a lot of trouble to get only the "add-on" apps. Can anyone help me ?

 

Thanks a lot.

JoPs
Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Filter the list of applications

[ Edited ]

Use CodeModuleManager.getModuleName() and filter on net_rim_bb or net_rim.

 

That is your first step. As far as showing only what is in "Add-on", i'm not sure of the additional criteria required for that.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
New Developer
dst17
Posts: 14
Registered: ‎11-02-2009
My Device: 9500 Storm

Re: Filter the list of applications

Thanks but this doesn't really help. Facebook or Twitter are "Add-on" apps and their module name starts with net_rim_bb...

 

Thanks anyway !

JoPs