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
Posts: 178
Registered: ‎08-26-2009
My Device: Not Specified
Accepted Solution

JSON JAR File

Hi,

 

I would like to know how to create a .JAR file from http://www.json.org/java/org.json.me.zip . I want to be able to add it as a JAR file instead of adding adding all the classes to the project directly. Could someone help me.

 

I tried various methods with no success. The preverify kept failing.

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: JSON JAR File

You could create a Library project and import the classes there then build. Once built, a jar will be generated for the new project. You could then include it in any of your future projects.

 

If you're using Eclipse let me know. I barely use the JDE now so I don't remember where everything is.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 178
Registered: ‎08-26-2009
My Device: Not Specified

Re: JSON JAR File

Hi

Highlighted
Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: JSON JAR File

[ Edited ]

Make sure that your projects are using similar compliance levels. Also try cleaning and rebuilding your project. Since the project is now a BlackBerry library, try just adding a reference to the library project in the main project instead of directly adding the JAR.

 

From then on, when you package your project, your  library project is automatically added to the simulator. When you deploy to a real device, it becomes a different story. If you are deploying over the air, you need to update your JAD file to include references to the library cod file.

 

You can use the UpdateJad executable found in the bin folder of one of your component packs to do this. Just do:

 

 

updatejad Main.cod Library.cod

 

 

And it will do the rest for you (even create a backup of the old JAD). You'd need to make sure to either give the full paths to each cod or run updatejad on a folder that contains all necessary COD files.

 

If you're using Desktop Manager, I believe the dependences are added to the ALX automatically and you just have to copy the library cod file in (not 100% on this though.

 

Long-winded post but hopefully it helps others.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
New Developer
Posts: 134
Registered: ‎01-11-2011
My Device: curve

Re: JSON JAR File

HI everyOne

                    I am working on an app that required a webservice consumption.I successfully add ksoaplibrary jar file to my project and get the response

 

 

ValidateMemberLoginResponse{ValidateMemberLoginResponse_Data=anyType{IsSuccessful=true; MessageText=anyType{}; ?Category=MobileApp&Action=Login; FunctionStatusResults=anyType{FunctionStatus=anyType{FunctionName=PriceAndSave; Status=false; OverrideHTML=anyType{}; FunctionTitle=Catalyst Price & Save[SM]; }; FunctionStatus=anyType{FunctionName=MyPrescriptions; Status=true; OverrideHTML=anyType{}; FunctionTitle=My Prescriptions; }; FunctionStatus=anyType{FunctionName=LocatePharmacies; Status=true; OverrideHTML=To locate your pharmacy, <a href='http://www.dummylink.com'>click here</a>; FunctionTitle=Locate Pharmacies; }; FunctionStatus=anyType{FunctionName=CoveredDrugLists; Status=true; OverrideHTML=anyType{}; FunctionTitle=Covered Drug Lists; }; FunctionStatus=anyType{FunctionName=CoPayInformation; Status=true; OverrideHTML=anyType{}; FunctionTitle=Co-Pay Information; }; FunctionStatus=anyType{FunctionName=DrugAlternatives; Status=false; OverrideHTML=anyType{}; FunctionTitle=Drug Alternatives; }; FunctionStatus=anyType{FunctionName=DrugDictionary; Status=true; OverrideHTML=anyType{}; FunctionTitle=Drug Dictionary; }; FunctionStatus=anyType{FunctionName=WhatIsCovered; Status=true; OverrideHTML=anyType{}; FunctionTitle=What's Covered; }; FunctionStatus=anyType{FunctionName=MailService; Status=true; OverrideHTML=anyType{}; FunctionTitle=Mail Service; }; FunctionStatus=anyType{FunctionName=MyProfile; Status=true; OverrideHTML=anyType{}; FunctionTitle=My Profile; }; FunctionStatus=anyType{FunctionName=ContactUs; Status=true; OverrideHTML=anyType{}; FunctionTitle=Contact Us; }; FunctionStatus=anyType{FunctionName=About; Status=true; OverrideHTML=anyType{}; FunctionTitle=About[SM]; }; FunctionStatus=anyType{FunctionName=TermsAndConditions; Status=true; OverrideHTML=anyType{}; FunctionTitle=Terms & Conditions; }; }; }; }

 

 

 

I Know this is json object .But the problems starts here b'coz i am not able to add json.jar  to my project.I tried for this but then my app have'nt appear in the simulator

Plz help me

how to add json.jar

Or how i can parse this response

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: JSON JAR File

Welcome to the forum.

 

Please don't post on solved Threads.  If you have a new problem, please start a new Thread.

 

If you search the forum you will find other people have talked about including JSON in their projects, I suspect one of these Threads will resolve hour problem too.  So use the Search facility to look for more information. 

New Developer
Posts: 134
Registered: ‎01-11-2011
My Device: curve

Re: JSON JAR File

Hi peter

           Thanks for the reply.:manvery-happy

           Peter i even i don't know how to start a new thread for a new question.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: JSON JAR File

"how to start a new thread"

 

When you are looking at the list of Threads, there is a 'new' button at the top left hand side of the list. 

 

In addition, there is help link near the top, press on that and you will find loads of useful information. 

New Developer
New Developer
Posts: 151
Registered: ‎01-05-2010
My Device: dev alpha c (bb10)
My Carrier: www.rzr.online.fr

Re: JSON JAR File

thanks for this tip :     updatejad Main.cod Library.cod

but now i am wondering how to to build a lib which depends on json jar and make the app link w/ my lib.jar and json.jar , can this be done a simple way ?