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: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

still not clear on jad and module usages for shared code.

I'm still not sure what is supposed to work and what really works for packaging shared

code that allows a user a one-click download irrespective of what existing pieces they have.

I'm willing to let unneeded library updates occur, but I need consistency otherwise.

 

I guess I understand you can specifiy multiple COD files in one jad and there is a RIM-flag entry

to specify library code. But, it isn't clear how you specify multiple modules in one jad ( which is

what I think I want, one for the library and one for the app that invokes the library ).

 

 

I guess what I'm thinking is that the library ( whatever this actually means as even without "library" build option  I

get multiply defined class errors trying to load different module names that share the files, apparently it

makes the classes, as opposed to the app, visible for usage by others.

 

) goes in one module

and each app in a separate one.

 

Library cod files contain classes like,

 

 

class mylibraryapp

{

myapp(myparam x) ...

 

 

}

class myparam

{...}

 

 

and then in the actual "app"'s I have things like

 

class appparam extends myparam {...}

 

class real_app_class

{

static void main(String [] )

{ new mylibraryapp(appparam()); ...}

 

}

 

 

What would a jad file look like to allow a user to download some real_app_class and library from one click?

I think someone else mentioned alternative entry points, but in this scenario the library doesn't have

any "entry points" that the OS cares about, just a bunch of public signatures the "real app" ( that the

OS invokes) can make use of.

 

 

Thanks.

 

 

 

 

 

 

Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: still not clear on jad and module usages for shared code.

RIM-COD-URL-2: ksoap2_j2me_core.cod
RIM-COD-SHA1-2: da 40 33 97 8b a0 28 2c 85 6e a1 69 b1 36 94 75 76 f7 4d 79
RIM-COD-Size-2: 34728

these are the entries in a jad-file that i make to add my ksoap2 library. i am not sure if the SHA-entry is needed as i saw some people posting similar stuff without it.
if your program has multiple cods they are numbered, just add your library link with the next free number.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: still not clear on jad and module usages for shared code.

I guess my question would be, " what is the module name for the library?"

That is, for each app that uses the library, I create a jad to specify the app cod and the library cod ( library

of course is the same in each app's jad). But, each jad specifies a module that AFAIK get's applied to each cod.

Is this true? Is there some way to set the RIM flags and module info so that one jad

specifies library and app-specific code and pieces that go into different modules or

is none of this needed?

I think I want the library module name to be constant for each app but not sure.

 

 

Thanks.

Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: still not clear on jad and module usages for shared code.

the name of my library file does always stay the same, i add the same three lines in every jad file after i created it. kind of too lazy to integrate it into a build system Smiley Happy

personally i decided against a seperate library as i change code in it from time to time. i add the needed classes directly to the projects.
as long as i do not use Persistable in custom classes that works pretty good.
i don't have to think about versioning and, as a corporate developer, i don't think i'll ever have many customers running more then one software from me so the saved space is not an a point.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: still not clear on jad and module usages for shared code.

It looks like this approach loaded and ran but haven't fully tested it yet.

I have no idea what this would do with sibling cods ( if you have multiple cod's per module, do you

just specifiy the same module name and it figures out they shouldn't overwrite each other?)

The first thing is the library, which I can presumably share, and the second one is the app,

 

RIM-COD-URL-2:  http://www....com/xxx/xxx.cfm?filename=MJM010_99_0_4545.cod
RIM-COD-Size-2: 70964
RIM-COD-Module-Name-2: Phlapper
RIM-COD-URL-1:  http://www........com/xxx/xxx.cfm?filename=XXX610_10_0_4545.cod
RIM-COD-Size-1: 60364
RIM-COD-Module-Name-1: XXX610_10_0_4545

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

Re: still not clear on jad and module usages for shared code.

My experience with shared cods in multiple jads is not great.  Assume I have a library cod L and two application cods A and B which use L.  I create a jad for each application,, both of which contain L.  I load A first, then loading B will delete A.

 

I know it is confusing for users, but the only safe way I've found, is to have the Library cod in a separate download.  If theory, I suspect this does have the advantage in that I can update the Library without removing the applications, though I have never tried this.

 

Just my experience, hope ths helps.

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: still not clear on jad and module usages for shared code.

afaik, this is working for now- I have two jads that load L along with A or B. Sure, each load replaces L

but it seems to work ok as they both put functioning icons on the desktop.I'm having a problem

renaming classes with persistent store but otherwise this seems transparent to existing app.

 

 

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

Re: still not clear on jad and module usages for shared code.

Good to hear.

 

Can you tell what device and OS Level you see this on?  I have also seen it work correctly (i.e. allow the Library to be shared), and am trying to work out when it does and when it doesn't.  Unfortunately there are loads of variables, such as OS Level, whether the shared cods are Libraries or shared applications, how the jad is constructed etc.  I've never really had a go at figuring out what works and what doesn't.