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
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Using JDE and have a JAD in the tree

I am using the JDE to dev a BB app and have a JAD added to the list of files.

How do I read it? Its seems not to read, like the PNG icon I click right on it and say it is the app icon

when installed on the emulator and that work is there something special with a JAD?

Please use plain text.
Developer
kemdada
Posts: 37
Registered: ‎10-10-2008
My Device: Not Specified

Re: Using JDE and have a JAD in the tree

I don't think there is a jad reader. You have to look at the jad manually by opening the file directly using a text editor like Notepad or Textpad.

 

Also, I don't think you should be adding a jad to your project (unless you want to use an added jad file for something else), the JDE generates the jad file automatically for you and places it in your project folder.

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

Re: Using JDE and have a JAD in the tree

Well thats funny, my project is called bbitm and I have jad called bbitm.jad added to it.

If I make the vender a different name the JDE complains which is good. So I have no idea why I cannot read the fields

out of it. I use a JAD for deployment.

Please use plain text.
Developer
kemdada
Posts: 37
Registered: ‎10-10-2008
My Device: Not Specified

Re: Using JDE and have a JAD in the tree

I'm not sure what you mean when you say you cannot read the fields. can you elaborate further?
Please use plain text.
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: Using JDE and have a JAD in the tree

This is my JAD file added to my project. If I edit the version number the JDE wil lcomplain as I 

have  it setup in the JDE as 1.0 which is good. I want to read all the XMIDLET properties

and I get nothing using  the following code

 

Created-By: IBM Corporation
Manifest-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0
MIDlet-1: bbitm, itm.png, com.ibm.tivoli.midp.bbitm
MIDlet-Description: ITM Blackberry
MIDlet-Jar-Size: 54308
MIDlet-Jar-URL: bbitm.jar
MIDlet-Name: bbitm
MIDlet-Permissions: javax.microedition.io.Connector.https
MIDlet-Vendor: IBM Corporation
MIDlet-Version: 1.0

RIM-COD-Creation-Time: 1225994433
RIM-COD-Module-Dependencies: net_rim_cldc
RIM-COD-Module-Name: bbitm
RIM-COD-SHA1: d8 44 38 1e 07 d4 e0 7c 00 bf cf 53 c0 a2 a3 24 d3 03 73 fd
RIM-COD-SHA1-1: e3 52 4c 9d d1 bd 32 a6 e7 4d db 63 d1 e2 f1 09 8c db cf bc
RIM-COD-Size: 23056
RIM-COD-Size-1: 58392
RIM-COD-URL: bbitm.cod
RIM-COD-URL-1: bbitm.cod
RIM-MIDlet-Flags-1: 0

XMIDlet-Device-host: http://whatever:1920///cms/soap
XMIDlet-Device-password: password
XMIDlet-Device-piechart-full: false
XMIDlet-Device-query: <CT_Get><userid>sysadmin</userid><password></password><object>NT_Logical_Disk</object><attribute>Server_Name</attribute><attribute>%_Used</attribute><attribute>%_Free</attribute><target>*ALL</target></CT_Get>
XMIDlet-Device-refresh: 2
XMIDlet-Device-user: sysadmin

 

 

public class bbProperty {
    CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll();
    CodeModuleGroup myGroup = null;

    static public String getDeviceName(){
        return DeviceInfo.getDeviceName();
    }

    public  bbProperty(){
        String moduleName = ApplicationDescriptor.currentApplicationDescriptor().getModuleName();

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

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

 

 

This will work on the real device but not on the emulator

using for example

 

String s= bbProperty.getAppProperty("XMIDlet-Device-host");

 

 

Please use plain text.