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
miskatonic
Posts: 83
Registered: ‎02-17-2009
My Device: Not Specified
Accepted Solution

jad question related to dependencies...

Hi,

 

A very specific question...

 

I have two projects, a cldc app and a library app, the first one with dependencies on the other. If I install it in my device using alx, there's no problem providing that I have app.cod, library.cod and app.alx in the same folder.

What i am not sure, and i can't test by now, is if it'll have the same behaviour using .jad

As i see inside the jad, there isn't any reference to library.cod as it happened inside the app.alx. There is only a module dependency on library module. This makes me think that i'll need to have my library installed in the device before trying to install my app.

Am i wrong? Is it possible to install both the library and the app with a unique jad?

 

Thanks in advance

Please use plain text.
Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: jad question related to dependencies...

Yes, you can install both cods using same app.alx

 

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

 

 

 

 

Deepesh Gupta
Please use plain text.
Developer
miskatonic
Posts: 83
Registered: ‎02-17-2009
My Device: Not Specified

Re: jad question related to dependencies...

But what i want is install them using one JAD in an OTA install...
Please use plain text.
Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: jad question related to dependencies...

yes you can also install both the .cod files using same JAD file also.

 

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

 

 

 

Deepesh Gupta
Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: jad question related to dependencies...

Review the Developer Guide for more details.  See the section called

"Distributing BlackBerry Java Applications over the wireless network"

in the Chapter called

"Packaging and distributing BlackBerry Java Applications"

for more details.

Please use plain text.
Developer
miskatonic
Posts: 83
Registered: ‎02-17-2009
My Device: Not Specified

Re: jad question related to dependencies...

Thanks a lot for your answers,

 

So, do i have to use de updatejad tool or it's just adding the lib.cod url to the app.jad?
Please use plain text.
Developer
jobincantony
Posts: 26
Registered: ‎08-04-2008
My Device: Not Specified

Re: jad question related to dependencies...

Hi,

 

Say you have an application named SampleApplication and two library modules named  MyLibrary1 and MyLibrary2.

 

You want to do OTA of  SampleApplication with SampleApplication.jad file which automatically installs both libraries along with your app.

 

Follow the steps:

 

1. Build all the applications. You will get  3 cod files and 3 jad files

2. Open  MyLibrary1.jad file in notepad and copy the values of RIM-COD-URL:, RIM-COD-SHA1:and RIM-COD-Size: from the file and save it in a new text file say temp.txt.

3. Open  MyLibrary2.jad file in notepad and copy the values of RIM-COD-URL:, RIM-COD-SHA1:and RIM-COD-Size: from the file and save it in temp.txt.

4  Rename the values of MyLibrary2.jad file in temp.txt as RIM-COD-URL-1:,RIM-COD-SHA1-1:and RIM-COD-Size-1:

5 Open  SampleApplication.jad file in notepad and rename the values like RIM-COD-URL-2:,RIM-COD-SHA1-2:and RIM-COD-Size-2:

6. Copy values from temp.txt to  SampleApplication.jad 

7. Remove MIDlet-Jar-Size: and MIDlet-Jar-URL:  properties from SampleApplication.jad 

8. Copy all the .cod files and SampleApplication.jad  file in a single directory

9. Now your  SampleApplication.jad  file is ready for OTA with  your library modules :smileyvery-happy:

 

Sample .jad file

 

 

Manifest-Version: 1.0 MIDlet-Version: 01.00.00 MicroEdition-Configuration: CLDC-1.1 RIM-COD-Module-Dependencies: net_rim_cldc,MyLibrary1,MyLibrary2 RIM-MIDlet-Flags-2: 0 RIM-MIDlet-Flags-1: 3 RIM-COD-Module-Name: SampleApplication MIDlet-Name: SampleApplication RIM-COD-Creation-Time: 1236762075 MIDlet-1: SampleApplication,images/sampleImage.png, MIDlet-Description: Sample Application for Blackberry MicroEdition-Profile: MIDP-2.0 MIDlet-Vendor: JobinCAntony RIM-COD-URL: MyLibrary1.cod RIM-COD-SHA1: 8f 1f e6 03 c5 b7 82 18 df d0 54 12 af ab 61 41 12 eb 46 ca RIM-COD-Size: 24852 RIM-COD-URL-1: MyLibrary2.cod RIM-COD-SHA1-1: cf 38 97 fb f7 4d e9 3a db 6b 07 1a ad da 9e 92 31 ec bd f2 RIM-COD-Size-1: 1844 RIM-COD-URL-2: SampleApplication.cod RIM-COD-SHA1-2: a7 5c d8 ed 76 c3 4e d9 17 0b 4a 23 6b 2f c4 1c 85 e4 2c f4 RIM-COD-Size-2: 5142

 

 You can test it with device simulator.

 

1) Set-up a Tomcat server, copy these files in to webapps folder of tomcat 

2) Start MDS simulator

3) Start device simulator and access  SampleApplication.jad file from your application.

4) Download

 

JOBIN

 

 

 

 

 

 

Please use plain text.
Developer
miskatonic
Posts: 83
Registered: ‎02-17-2009
My Device: Not Specified

Re: jad question related to dependencies...

Extremely clear,

 

Thanks a lot Jobin

Please use plain text.
Developer
konic
Posts: 173
Registered: ‎06-11-2009
My Device: Not Specified

Re: jad question related to dependencies...

[ Edited ]

jobincantony wrote:

 

1) Set-up a Tomcat server, copy these files in to webapps folder of tomcat 

2) Start MDS simulator

3) Start device simulator and access  SampleApplication.jad file from your application.

4) Download

 


OK,

but one thing was somehow missed.
I mean:

RIM-MIDlet-Flags-2: 0
RIM-MIDlet-Flags-1: 3

Looks like it says that SampleApplication (2) is an Application, and  MyLibrary2 (1) is a system module. But what about MyLibrary1 (0)? What is that flag default value?

Message Edited by konic on 08-18-2009 12:15 PM
Please use plain text.
Contributor
om_bbdeveloper
Posts: 44
Registered: ‎01-12-2011
My Device: Not Specified

Re: jad question related to dependencies...

http://docs.blackberry.com/en/developers/deliverables/11938/Create_jad_files_that_reference_multiple... 

 

 this link. It contains a command that automatically copies the linked .jad file references to main .jad

Please use plain text.