本文介绍了如何使用黑莓获得软件包名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新黑莓的发展,是否有可能得到它安装在设备中的应用程序包名称。我din't得到这方面的任何引用。

  INT [] =处理codeModuleManager.getModuleHandles();
        的for(int i = 0; I< handle.length;我++){
            ApplicationDescriptor [] = app_descriptors codeModuleManager.getApplicationDescriptors(处理[I]);
                如果(app_descriptors!= NULL){
                    的System.out.println(app_descriptors长度+ app_descriptors.length);
                    对于(INT J = 0; J< app_descriptors.length; J ++){
                        的System.out.println(遍历该ArrayList ::+ app_descriptors [J]的ToString());
                    }
                }
        }


解决方案

试试这个 -
这将让所有已安装的模块。

  INT [] V = net.rim.device.api.system数据codeModuleManager.getModuleHandles()。

有关获取与该模块相关的ApplicationDescriptors,请使用以下code -

  net.rim.device.api.system数据。codeModuleManager.getApplicationDescriptors(INT moduleHandle)

编辑: -

  INT [] =处理codeModuleManager.getModuleHandles();
    的for(int i = 0; I< handle.length;我++){
        ApplicationDescriptor [] = app_descriptors codeModuleManager.getApplicationDescriptors(处理[I]);
            如果(app_descriptors!= NULL){
                的System.out.println(app_descriptors长度+ app_descriptors.length);
                对于(INT J = 0; J< app_descriptors.length; J ++){
                     字符串MODULENAME = app_descriptors [I] .getModuleName();
                     字符串名称= app_descriptors [I] .getName();
                }
            }
    }

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());
                    }
                }
        }
解决方案

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


                }
            }
    }

这篇关于如何使用黑莓获得软件包名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 16:53