Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Administrator
MSohm
Posts: 14,444
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Multiple JAD deployment of a COD

You should have received 3 csi files (RBB, RCR & RRT).  devsupport@rim.com can help you with this.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: Multiple JAD deployment of a COD

The three *.csi files was a problem for signing. Also I cannot seem to get the COD on a BB 8700 now

for JDE4.3 using the CodeModuleGroupManager  type functions. It says bad cod file. So is this function

availability limited in some way? 

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,444
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Multiple JAD deployment of a COD

Please make sure you are using a version of BlackBerry JDE that is supported by the BlackBerry handheld software on the BlackBerry you are using.

 

What Is - Appropriate version of the BlackBerry JDE
Article Number: DB-00537

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800738/800901/What_Is...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: Multiple JAD deployment of a COD (Did Not Work)

import net.rim.device.api.system.*;


public class mybbProperty {
    CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll();
    CodeModuleGroup myGroup = null;
    String moduleName = ApplicationDescriptor.currentApplicationDescriptor().getModuleName();

    public void mybbProperty(){
        versForm.debugtext=moduleName;
        for (int i = 0; i < allGroups.length; i++) {
            if (allGroups[i].containsModule(moduleName)) {
                myGroup = allGroups[i];
                break;
            }
        }
    }

    public String getAppProperty(String name){
        return myGroup.getProperty(name);
    }
}





eg:

    mybbProperty bb= new mybbProperty();
    tbsmSpec.host     = bb.getAppProperty(m,"XMIDlet-Device-host");

Really did not work for the Device other than getting the JAD settings in original COD
file like MIDlet getAppProperty().


Here is the scenario. I built a my.COD file with a my.JAD file that has the
property set to

XMIDlet-Device-host: 127.0.0.1

I connect to a website which has a JAD file called otherhost.jad and
my.COD. The otherhost.jad has the field set to

XMIDlet-Device-host: otherhost

I install the application from the web link (which is otherhost.jad)
It installs nicely. I run the application which should use this code
below to get properties not the MIDlet getAppProperty().

    mybbProperty bb= new mybbProperty();
    tbsmSpec.host     = bb.getAppProperty(m,"XMIDlet-Device-host");

I still get 127.0.0.1?


On the website we can have ten different JADS which have different Hosts
set and only one COD file which is the application. So what modification
to the above code is needed as I think the containsModle is matching.
Its hard to debug.
Please use plain text.
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: Multiple JAD deployment of a COD (Did Not Work)

And I think moduleName is null as a result in the code.

 

    String moduleName = ApplicationDescriptor.currentApplicationDescriptor().getModuleName();

 

 So I am not sure where to go as I do not know what this code assumes and is looking for?

 

my COD file is my.COD and using the Blackberry to look at modules for an application via the Advanced Options

says "my" in the list. Like I said I am not sure what its looking for but somehow this code needs to find the property in the JAD that installed this application not the one that made the COD. 

 

 

Please use plain text.
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: Multiple JAD deployment of a COD (Did Not Work)

This code from this article says BlackBerry Device Software 4.3 and later.

I have checked out the API functions documentation and they all fit under

4.2.1 which is what I have installed. Maybe thats the cause?

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800708/800646/How_To_-_Programmatically_read_the_attributes_of_a_JAD_file.html?nodeid=1382517&vernum=0

 

To read JAD from a deployed code via a WEB

 

MIDlet example:

String description = MIDlet.getAppProperty("MIDlet-Description");
String custom = MIDlet.getAppProperty("My-Custom-JAD-Property");

 

BlackBerry smartphone API example:

 

CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll();
CodeModuleGroup myGroup = null;
String 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 description = myGroup.getProperty("MIDlet-Description");
String custom = myGroup.getProperty("My-Custom-JAD-Property");

 

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,444
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Multiple JAD deployment of a COD (Did Not Work)

What you are seeing is the expected behaviour.

 

Accessing JAD attributes added after build time is supported in BlackBerry handheld software version 4.3.0 and higher.  Prior versions are only able to access parameters already present in the JAD file at build time.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
jflores
Posts: 7
Registered: ‎07-22-2008
My Device: Not Specified

Re: Multiple JAD deployment of a COD (Did Not Work)

Hi,

 

I've been trying to access the jad using the CodeModuleGroup class.  I've seen most if not all of the RIM documentation mentioned in this and other threads.  I've written this simple app to print the jad contents on the screen, but it's not working correctly.

 

import java.util.Enumeration; import net.rim.device.api.system.ApplicationDescriptor; import net.rim.device.api.system.CodeModuleGroup; import net.rim.device.api.system.CodeModuleGroupManager; import net.rim.device.api.ui.UiApplication; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.component.RichTextField; import net.rim.device.api.ui.container.MainScreen; public class JadReader extends UiApplication { public static void main(String[] args) { JadReader theApp = new JadReader(); theApp.enterEventDispatcher(); } public JadReader() { pushScreen(new JadReaderScreen()); } } class JadReaderScreen extends MainScreen { public JadReaderScreen() { super(DEFAULT_MENU | DEFAULT_CLOSE); setTitle(new LabelField("JAD Reader", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH)); ApplicationDescriptor desc = ApplicationDescriptor.currentApplicationDescriptor(); CodeModuleGroup group = CodeModuleGroupManager.load(desc.getName()); if(group != null) { add(new RichTextField("Group: " + group.getName() )); for( Enumeration e = group.getPropertyNames(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); add(new RichTextField(name + ": " + group.getProperty(name) )); } } else { add(new RichTextField("Group is null")); } } public boolean onClose() { System.exit(0); return true; } }

 

The The output looks like this:

 

Group: jadReader

GroupType: NonSystem

 

I'm using jde 4.3 and cable loading the application onto an 8130.  I appreciate any help you can give me.  

 

Thanks.

 

 

 

 

 

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,444
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Multiple JAD deployment of a COD (Did Not Work)

What browser are you using to install your application on?  Can you elaborate on exactly what is not working in the application?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
jflores
Posts: 7
Registered: ‎07-22-2008
My Device: Not Specified

Re: Multiple JAD deployment of a COD (Did Not Work)

Hi Mark,

 

My code is supposed to print out the contents of the jad on the screen.  The jad file I'm using the one generated by the BB Eclipse Emulator and it looks like this:

 

Manifest-Version: 1.0
RIM-COD-Module-Name: jadReader
RIM-COD-Module-Dependencies: net_rim_cldc
MIDlet-Jar-Size: 3916
MIDlet-1: ,,
RIM-COD-Creation-Time: 1218243565
MIDlet-Jar-URL: jadReader.jar
RIM-COD-URL: jadReader.cod
RIM-COD-SHA1: 8a 1f 9a e5 86 9c 44 4f b5 97 a5 e4 c1 14 bc 04 9e 72 2f f2
RIM-COD-Size: 1796
MicroEdition-Configuration: CLDC-1.1
MIDlet-Version: 0.0
MIDlet-Name: jadReader
MIDlet-Vendor: Hands-On Mobile
MicroEdition-Profile: MIDP-2.0
RIM-MIDlet-Flags-1: 0



I expect the code to printout something similar, but when I run it, I see one of two behaviors depending on how the application was loaded:

 

1.  When I cable load the application using the BlackBerry Desktop Manager (v4.3.0.17), getPropertyNames() returns just one name, "GroupType".  And getProperty("GroupType") returns "NonSystem".

 

2.  When I intalled the appliation over the air using the native blackberry browser, CodeModuleGroupManager.load(desc.getName()) returns null.

 

The looks ok, so I am not installing the application properly?

Thanks for your help.

 

 

 

Please use plain text.