How to get package name using blackberry

﹥>﹥吖頭↗ 提交于 2019-12-25 05:25:45

问题


I am new to blackberry development, Is it possible to get package name of the application which is installed in device. I din't get any reference for this.

 int[] handle = codeModuleManager.getModuleHandles();                    
        for(int i=0; i<handle.length; i++){  
            ApplicationDescriptor[] app_descriptors = CodeModuleManager.getApplicationDescriptors(handle[i]);               
                if(app_descriptors != null){ 
                    System.out.println("app_descriptors length "+ app_descriptors.length);   
                    for(int j=0; j< app_descriptors.length; j++){
                        System.out.println("Iterating the arraylist :: "+ app_descriptors[j].toString());
                    } 
                }               
        }      

回答1:


Try this - This will get all the installed modules.

int[] v=net.rim.device.api.system.CodeModuleManager.getModuleHandles();

For getting the ApplicationDescriptors associated with the module, use the following code -

net.rim.device.api.system.CodeModuleManager.getApplicationDescriptors(int moduleHandle)

Edit : -

int[] handle = CodeModuleManager.getModuleHandles();                    
    for(int i=0; i<handle.length; i++){  
        ApplicationDescriptor[] app_descriptors = CodeModuleManager.getApplicationDescriptors(handle[i]);               
            if(app_descriptors != null){ 
                System.out.println("app_descriptors length "+ app_descriptors.length);   
                for(int j=0; j< app_descriptors.length; j++){
                     String moduleName = app_descriptors[i].getModuleName();
                     String name = app_descriptors[i].getName();


                } 
            }               
    }    


来源:https://stackoverflow.com/questions/11843270/how-to-get-package-name-using-blackberry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!