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: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000
Accepted Solution

is it possible to install application without user interaction? in background?

hi, is it possible to do such a thing:

 

device asks server for an application, server responses and "give me" address from which i can download a *.cod file. is it possible that i'll download it (and install) without user interaction? i mean-no browser will open, user won't click on anything etc. application will download in the background without user interaction? is it possible? and if yes-how?

 

 

 regards

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

Re: is it possible to install application without user interaction? in background?

yes. and the answer is the same as in your similar posts, codemodulemanager allows you to install a module. you can download it using http (or whatever).
----------------------------------------------------------
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: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: is it possible to install application without user interaction? in background?

something like:

 

 _httpConnection = (HttpConnection) Connector.open(_urlToMyApplicationCod);

_dataInputStream = _httpConnection.openDataInputStream();

 

while((_c = _dis.read()) != -1){

 

_stringBuffer.append((char)_c);

}

 

_httpConnection.getResponseCode();

 

so then-my cod file is in stringBuffer. how then i can save it on the device?

 

and then - when (how?) i'll save it-use CodeModuleManager for installation.. yes?

 

Highlighted
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: is it possible to install application without user interaction? in background?

use IOUtilities.streamToBytes to read the file directly to a byte-array.
use createNewModule with the byte-array to create a new module.
use saveNewModule to save the module, call promptForResetIfRequired() if necessary.
----------------------------------------------------------
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: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: is it possible to install application without user interaction? in background?

ok, i'll do as You suggest and let You know if it works.

 

         regards

Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: is it possible to install application without user interaction? in background?

it works and it is so simple!

thank You very much for explanation and example, regards!