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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Trusted Contributor
Posts: 102
Registered: ‎03-01-2010
My Device: 8310
My Carrier: Ingenieur

Jdom in blackberry application

[ Edited ]

Hi;

 

i am using JDOM to manipulate an xml file into a blackberry application :

this is the code :

 

Callback = new TreeCallback();
            
            tree=new TreeField(Callback, TreeField.FOCUSABLE);
            
            
             SAXBuilder parser = new SAXBuilder();
             org.jdom.Document doc = parser.build("data.xml");
             Element docu=doc.getRootElement();
             Element node = docu.getChild("outline");
             List entries=node.getChildren("outlineentry");
      
             //On crée un Iterator sur notre liste
             Iterator i = entries.iterator();
             while(i.hasNext())
             {
                     //On recrée l'Element courant à chaque tour de boucle afin de
                     //pouvoir utiliser les méthodes propres aux Element comme :
                     //selectionner un noeud fils, modifier du texte, etc...
    
                     Element courant = (Element)i.next();
                     Attribute type= courant.getAttribute("type");
                     Attribute label= courant.getAttribute("label");
                     if (type.getValue()=="none")
                     {
            
                         int    node1 = tree.addChildNode(0, label.getValue());
          
                                 while(i.hasNext() && type.getValue()=="namedelementlink")
                                     {
                                     int    node2=tree.addChildNode(node1, label.getValue());
       
                                     }
               
                     }
            }
            
            
             add(tree);

 

That's whay i put this loop to read just some nodes ? when i run my project i have this exception :

Error Starting :Module Jdom not found ,but i have added the JDOM.jar in the class path

 

in your opinion what's the problem for me????

can any oen help me ?

 

 

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Jdom in blackberry application

You added JDOM to your class path so it would compile but JDOM doesn't exist on the BlackBerry so you get the error it can't be found.

 

Look up how to add a 3rd party library to your BlackBerry, that should fix it.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Trusted Contributor
Posts: 102
Registered: ‎03-01-2010
My Device: 8310
My Carrier: Ingenieur

Re: Jdom in blackberry application

Thank you very much  for repling ;

 

Can you tell what do you mean by adding  a 3rd party library to my BlackBerry,i don't find any source to start .

can you explain to me ??

 

thank in advance ;

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Jdom in blackberry application

The library jar must be compiled as a COD and added to your JAD file (for OTA download). If you are installing on the phone manually, then the library COD will also need to be loaded using javaloader.

 

If you search the forum for "library cod" you will find many discussions.

 

Here is one:

 

http://supportforums.blackberry.com/t5/Java-Development/Adding-a-Library/m-p/414941