Wednesday, October 28, 2009

Programmatically Read JAD file in Blackberry

in here following code worked but you have to deploy the application using JAD file (download through the web)  not the using alx file.

public static String getJADProperty(String Name){
    CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll();
    CodeModuleGroup myGroup = null;
    String moduleName="";
    moduleName = ApplicationDescriptor.currentApplicationDescriptor().getModuleName();
    for (int i = 0; i < allGroups.length; i++) {
    if (allGroups[i].containsModule(moduleName)) {
    myGroup = allGroups[i];
    break;
    }
    }
 
    // Get the property
    String prop = myGroup.getProperty(Name);
    return prop;
}

You can get the custom property by calling



// You can get the MyTag:something
String value = getJADProperty("MyTag")
Post a Comment