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
Administrator
MSohm
Posts: 14,421
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Obtained List of Installed Applications ...

Quote from the previous forums:


VipulPathak

Posts: 53
From: Columbia, MD
Registered: Apr, 2008

Obtained List of Installed Applications ...
Posted: Jun 25, 2008 8:18 AM
 
Hi,

Cen we Obtained the list of Installed Applications on a Blackberry device programmatically?

If yes, what is the API for this?

Thanks in Advance,

*(Vipul)() ;

 


skicson

Posts: 45
From: Columbia, MD
Registered: Feb, 2008

Re: Obtained List of Installed Applications ...
Posted: Jun 25, 2008 11:32 AM
 
One way to get it is this:

CodeModuleManager.getModuleHandles()

This will return a list of the module handles, then you can use other methods in CodeModuleManager to get the application name, etc.

If you're just looking for running apps, you can use:

ApplicationManager.getApplicationManager().getVis ibleApplications()


BTW, I guess you're just down the street :-)

 

VipulPathak

Posts: 53
From: Columbia, MD
Registered: Apr, 2008

Re: Obtained List of Installed Applications ...
Posted: Jun 25, 2008 10:39 PM
 
Thanks Skicson,
Right now I am in India. But, good to know that a blackberry expert is in the next street when I will be there :-)

 

VipulPathak

Posts: 53
From: Columbia, MD
Registered: Apr, 2008

Re: Obtained List of Installed Applications ...
Posted: Jun 26, 2008 6:26 AM
 
When I tried CodeModuleManager.getModuleHandles(), it returned a lot of handles (583) when I was expecting a handful of application handles (25-30).

Also, it appears that this is an installed component listing, e.g. it lists "net_rim_platform_resource__tr", "net_rim_platform_resource__ru", "net_rim_platform_resource__pl", "net_rim_platform_resource__nl", "net_rim_platform_resource__it" etc.

I then tried to obtain the CodeModuleGroups using the loadAll() method of CodeModuleGroupManager class. As far as I can understand, the a Code Module Group refers to all modules that are installed together and have dependency on each other, most likely when we install an application.

In this case, I got a list of ~100 items, including 1 entry for my application (which has dual entry point). When just doing the CodeModuleManager.getModuleHandles(), I was getting 2 entries for my same application. Additionally, I am seeing entries for system applications as well like- net.rim.blackberry.input.el Ver 4.2, net.rim.platform.lang.cs Ver 4.2, net.rim.platform.lang.ar Ver 4.2, net.rim.platform Ver 4.2, net.rim.java.tasks Ver 4.2.2, net.rim.java.phone Ver 4.2.2 etc.

So now, the question is that, Is CodeModuleGroupManager.loadAll() the correct way to obtain the list of installed application, or is there some thing more specific can be done to get accurate list of items (items that represent installed applications).

Thanks,

 

richard.puckett

Posts: 191
From: Seattle, WA
Registered: Jan, 2008

Re: Obtained List of Installed Applications ...
Posted: Jun 26, 2008 12:53 PM
 
If you just want applications then the following pseudo-code is what you'll want to do:

for (int i = 0; i < handles.length; i++) {
if (CodeModuleManager.isLibrary(handles<i>)) {
continue;
}
// You're dealing with an app handle here.
}


 

Guest
Re: Obtained List of Installed Applications ...
Posted: Jun 26, 2008 1:31 PM
 
Use CodeModuleGroupManager.loadAll() to obtain a list of installed application.

CodeModuleManager.getModuleHandles() returns a list of handles for every COD file on the device. It can be quite cumbersome to search through all the handles and determine which belong to the same application.

pHyRe

 

VipulPathak

Posts: 53
From: Columbia, MD
Registered: Apr, 2008

Re: Obtained List of Installed Applications ...
Posted: Jun 30, 2008 8:26 AM
 
Thanks Skicson, Richards and the Guest replier,

I am finally using CodeModuleGroupManager.loadAll(), since it appears to return most appropriate results as compared to CodeModuleManager.getModuleHandles.

Thanks all of you for the help.

 

VipulPathak

Posts: 53
From: Columbia, MD
Registered: Apr, 2008

Re: Obtained List of Installed Applications ...
Posted: Jul 21, 2008 10:50 PM
 
This thread may become a good future reference for people.

Marking to move this thread to the new forums ...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.