I want to get the application module name I have installed in Blackberry, just like "Messages","Contacts" etc. How can i get this module's names which are running now?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Check following code snippet:
//get the ApplicationManager
ApplicationManager appMan = ApplicationManager.getApplicationManager();
//grab the running applications
ApplicationDescriptor[] appDes = appMan.getVisibleApplications();
int size = appDes.length;
for (int i = size - 1; i >= 0; --i) {
String moduleName = appDes[i].getModuleName();
String name = appDes[i].getName();
// other codes....
}
Also read the API documentation for following classes:
ApplicationManager
ApplicationDescriptor
CodeModuleGroupManager
CodeModuleGroup
回答2:
You can get the current applications module name or handle by using this line:
String name = ApplicationDescriptor.currentApplicationDescriptor().getModuleName();
This returns the string of the module handle of this application. Or by using
int handle = ApplicationDescriptor.currentApplicationDescriptor().getModuleHandle();
回答3:
If you want to get the Application Version (programatically) you can use:
net.rim.device.api.system.DeviceInfo.getSoftwareVersion()
标签:
blackberry