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
Contributor
JamesMcMurray
Posts: 10
Registered: ‎03-30-2010
My Device: Emulator

Finding a unique application identifier

Is there a unique identifier that each application has which will report the same on every OS? For example, Android has the package name and Symbian has a UID. It looks like the Application ID in the alx file might be what I need, but I can't find a way to learn that programmatically.

 

ApplicationDescriptor.getName() or ApplicationDescriptor.getModuleName() might also work, but I've read posts saying that the different OS's handle encoding differently, so I can't be guaranteed that the same application will return the same string every time.

 

Thanks!

James

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Finding a unique application identifier

Hi and welcome to the forum.  :smileyhappy:

 

I'm not sure I understand the question.  Can you tell me what you would use this unique identifier for?

Contributor
JamesMcMurray
Posts: 10
Registered: ‎03-30-2010
My Device: Emulator

Re: Finding a unique application identifier

I'd like to be able to scan the running applications and react if any apps apps I'm interested in are being run. For example, the user currently has the messaging app in the foreground. I see that module net_rim_bb_messaging_app is in my list of trigger apps and respond (with logging, killing the app, or whatever). The issue is that I'm having a hard time figuring out how to uniquely identify them so I can make sure that the app I'm seeing is really the Blackberry Messaging App and not just some app that happens to have the same name.

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Finding a unique application identifier

I would look here. It may seem unrelated but the sample app that they have checks if a specific app needs to be installed, updated, or already exists. You can probably make it more specific by checking the vender name too.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
JamesMcMurray
Posts: 10
Registered: ‎03-30-2010
My Device: Emulator

Re: Finding a unique application identifier

Thanks! That sample is using the module name as the identifier, so that looks like my best bet. Now to try to find an easy way to know what all apps I should be interested in...

 

Does anyone know if there's a site like androlib.com that's geared towards the BlackBerry? Androlib.com scrapes the android marketplace and grabs information about each android application, including package names. The blackberry market itself would be nice, but it doesn't tell you the module name for each app.

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Finding a unique application identifier

It depends on what you want your app to do.

 

If you want to block certain apps that is user decided then the previous example has a menu item that retrieves the installed modules.

 

If you want to block certain apps then you can probably email the developers of whatever apps you want to interact with and ask them what their module names are, I can't think up a reason why they wouldn't want to except for that exact reason, they don't want to.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.