If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
eaoliver
Posts: 205
Registered: ‎07-14-2008
My Device: 7230, 8700, 8820, 9000
Accepted Solution

Installing cod files from a local file

Is it possible to install a cod file from a local source?   I would like to install a cod/jad or alx file located on //SDCard/ .

 

Earl 

 

 

Earl Oliver
Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Installing cod files from a local file

Read your cod file into memory as a byte array and then:

 

 

byte[] cod = getCodHoweverYouWant(); 

int newHandle = CodeModuleManager.createNewModule(cod.length, cod, cod.length); if (newHandle == 0) { // Do something informative here

return; } int code = CodeModuleManager.saveNewModule(newHandle, true);

 

  Use "code" to determine if the module was saved correctly (compare it to the CodeModuleManager.CMM_* constants). 

 

 

Please use plain text.
Developer
eaoliver
Posts: 205
Registered: ‎07-14-2008
My Device: 7230, 8700, 8820, 9000

Re: Installing cod files from a local file

Thanks Richard!
Earl Oliver
Please use plain text.
Administrator (Retired)
mkirkup
Posts: 179
Registered: ‎07-14-2008
My Device: Not Specified

Re: Installing cod files from a local file

You can also simply place your JAD file and cod files on the SD card.  Then simply point your browser at the JAD file on the SD card and it will install just like it does for a normal OTA installation.

 

For example, the link for the browser would be file://Media Card/BlackBerry/Applications/MyApplication.jad


Note that there is a current issue that the browser will not install the application if the radio for the device is "off" prompting the user to turn on the radio to access this resource even though it is local to the device.

 

Mike Kirkup
Director, Developer Relations
Please use plain text.
Administrator (Retired)
mkirkup
Posts: 179
Registered: ‎07-14-2008
My Device: Not Specified

Re: Installing cod files from a local file

Note that this will work but the application won't show up in the Application screen (Options->Advanced->Applications) unless you also use the CodeModuleGroup class to indicate to the VM that the modules together comprise an application.

 

Mike Kirkup
Director, Developer Relations
Please use plain text.
Developer
mooret
Posts: 18
Registered: ‎03-11-2009
My Device: 9530 Simulator 2.11.0.86

Re: Installing cod files from a local file

I'm trying to install my application and tried copying the single COD and uncompressed COD files w/ JAD file.  In both scenerios I download the application but then get a 907 Invalid COD, Unable to import ZIP file.  This is with the BlackBerry Storm.  Any suggestions?

 

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Installing cod files from a local file

Please see the following link.

 

Support - 907 Invalid Jar Error when installing an application wirelessly
Article Number: DB-00432

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800708/800646/Support...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Contributor
hfmf96
Posts: 22
Registered: ‎05-22-2013
My Device: Curve 8520
My Carrier: China Unicom

Re: Installing cod files from a local file

@richard. What do you mean by read the file into memory as byte array.....and what is the code for
HFMF96
Please use plain text.