开发者

To get the module names in blackberry

I want to get the application module name I have i开发者_高级运维nstalled in Blackberry, just like "Messages","Contacts" etc. How can i get this module's names which are running now?


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();


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


If you want to get the Application Version (programatically) you can use:

net.rim.device.api.system.DeviceInfo.getSoftwareVersion()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜