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

Web and WebWorks Development

Reply
Contributor
dbotelho
Posts: 21
Registered: ‎12-03-2010
My Device: Blackberry Bold 9700
Accepted Solution

Add an external library to a Javascript Ext

Hi,

 

Is it possible to use an external library in a Javascript Ext? If yes how?

 

Best regards,

Daniel Botelho

Retired
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold

Re: Add an external library to a Javascript Ext

Hi dbotelho,

 

Yes it is possible to use an external library in a Javascript ext.

 

As per the how, this is where it becomes more difficult. It really depends on how the external library is distributed. Is it compiled code, or is it a compile-time library and a cod file?

 

If its compiled code the answer is easier, you simply need to run it through the pre-verifier first and then include it in your extension.

 

If its a compile-time jar then you must specify it in your library.xml like so (stolen from the BBM extension) as a dependency. This way it will be compiled against but not included. Then you must load the library cod file as well as your app on to the device.

    <extension id="blackberry.bbm.platform">
	  <entryClass>blackberry.bbm.platform.BBMPlatformExtension</entryClass>
      <dependencies>
        <jar path="net_rim_bb_qm_platform.jar" />
      </dependencies>
    </extension>

 

Thats it



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
dbotelho
Posts: 21
Registered: ‎12-03-2010
My Device: Blackberry Bold 9700

Re: Add an external library to a Javascript Ext

Hi jeffheifetz,

 

Thanks for your answer!

After looking at this thread http://supportforums.blackberry.com/t5/Java-Development/BlackBerry-Eclipse-Plugin-Update-URL/td-p/13...

I managed to get it to work.

 

Setps to add the "lib.jar":

  • Added the <dependencies> tag to the library.xml
  • Added the file "lib.jar" to the plugin root
  • zipped all the content to "extension_name.jar"

Best regards,

Daniel Botelho


Retired
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold

Re: Add an external library to a Javascript Ext

Hi dbotelho,

 

Just so you know, we now traditionally advise you put the extension in the ext folder of the SDK as opposed to a jar in the project. It will mean a few extra values in the config.xml but it allows you to manage the same API across multiple apps more easily.

 

Also want to add your extension to our community API repo?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)