5

I'm looking for something corresponding to net.rim.device.api.system.ApplicationManager.getVisibleApplications(), but including applications that might not/do not have a UI. Any ideas?

Unreasonably complicated work-around solutions welcome, I'm growing slowly more sure that there's not a simple single call to do this...

Tim Perry
  • 8,453
  • 41
  • 62

1 Answers1

5

If you know the application name you can detect if it is running or not by checking the size of the array containing all AppDescriptor actually running this app.

int codeModuleHandle = CodeModuleManager.getModuleHandle(applicationPackageName);

if (codeModuleHandle != 0) {
   ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(codeModuleHandle);
}

You could imagine a code to get all installed application and then check

Benoit
  • 1,936
  • 16
  • 24
  • This works great, in combination with CodeModuleManager.getModuleHandles(), to get every module, and ApplicationManager.getProcessId(AppDescriptor) to check if they're running. Thank you! – Tim Perry Oct 13 '11 at 12:20