BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-02-2009, 03:45 AM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: 7100
PIN: N/A
Carrier: airtel
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb What is needed to "register" a COD pushed to a device

Please Login to Remove!

I'm not sure if this question has been taken up in other forum threads, did some searching, but got questions CLOSE to what I'm asking here, but not definitive for my purposes.

My question is manifold:

1. What constitutes an "installed" application? Does it mean that: a) the COD file is at a particular location in Blackberry file system (e.g. /store/home/application or something like that), b) is it "registered" anywhere in the Blackberry OS?

2. When using CodeModuleManager to locate an application, and then using ApplicationManager to launch it, what is the criteria for an application to be "discoverable" by the CodeModuleManager? Does it reside in a certain location on file system, or is it "registered" somehow (in effect, similar queries to question 1.).

2. The reason I'm asking above questions is this. I'm currently investigating development of a Blackberry application that can be used to "download" COD files from a server (that treats them just as "files", incidentally, no special handling), copies the downloaded files into a directory, and launches the application.

I've reached the stage where I can "download" COD files to a location on the Blackberry file system (i.e. I do it on "/store/home/user" by default). I've not proceeded ahead on the "find the COD, install it, and run it" part yet.. but I need to know:

Since this is VERY different from normal methods of pushing applicaitons to a Blackberry (i.e. using Desktop Manager with .alx files, or through javaloader which comes with JDE, or OTA with a server hosting a .JAD).. what would I need to do "behind-the-scenes" after the .COD file download in order to make the COD "installed", and "launchable" (I'm assuming that making the COD "installed" would open up a way for me to use ApplicationManager anyway, so don't really need too much details on "launchable").

Any responses (even flames :p) would be appreciated.
Offline  
Old 04-02-2009, 03:45 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2008
Location: Paris, France
Model: None
PIN: N/A
Carrier: None
Posts: 36
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

What you're looking for would amount to a gaping security hole. Hence I don't think that's possible.
Offline  
Old 04-02-2009, 03:51 PM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

I also have to wonder what you are trying to accomplish. The methods for installing applications either OTA or by USB are well documented.
Offline  
Old 04-05-2009, 02:12 AM   #4 (permalink)
New Member
 
Join Date: Apr 2009
Model: 7100
PIN: N/A
Carrier: airtel
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default security problem.. hmm...

I'm not sure I completely agree with both the points made:

1. Regarding it being a "security hole": I think I should explain why I've asked this particular question. In Java, its pretty easy to implement your own classloader, which can selectively "load" functionality in the form of classes in a separate context from the system classloader. Its possible to use classloading as a form of "dynamic loading".. where you can presumable download a bunch of classes (like for example, in a JAR file), define a separate "class path" for them, and then instantiate your own classloader to get them to work. This is well documented and extensively used (in fact, unless I'm completely off the mark, applets are basically classes streamed over HTTP and then loaded at run-time, right? basically, same principle)? Since Blackberry doesn't allow us to implement our own classloaders, that pretty much means I have to explore alternatives, hence the question about "dynamically" loading an app with specific functionality, and then launching it whenever needed (and... doing this in as automated a manner as possible). If I use OTA or any other method, it still requires the user to download the actual COD file that does the specific job, which is not my design goal.

2. Regarding the "documented" methods.. as I have already explained, I KNOW the methods of installation. I thought this particular point would be obvious, the "documented" methods do not work for my particular requirement (for the reasons, please see point 1.). Now if what I'm asking for is either: a)not implemented b)not allowed, I can understand, in which case I'm hoping that someone can point me to what the alternative is to dynamic class loading in Blackberry; that should solve my problem.
Offline  
Old 04-05-2009, 11:35 AM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Had you asked that question in the first place, yes you can instantiate classes from other modules (which must first be installed in the device using one of the documented methods). Use the Class.forName() method. The class you are creating and the calling class must be in the same package IIRC. I'm not at my office where my codebase is or I would post an example.
Offline  
Old 04-06-2009, 12:53 AM   #6 (permalink)
New Member
 
Join Date: Apr 2009
Model: 7100
PIN: N/A
Carrier: airtel
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the clarification!

Also, based on some additional reading of the forums I've done, I'm assuming that by "installing a module... by documented methods".. you would be referring to the CodeModuleManager APIs (i.e. createNewModule, saveNewModule, etc.)?

I would really, really appreciate that code sample you mentioned... I had the opportunity to try out these APIs, but I seem to be doing something wrong (I keep getting INVALID_MODULE CMM code). I've been successful in "copying" the COD file itself (which I'm trying to "load") into the file system, but the code to "extract" the contents into a byte array, and use CodeModuleManager to "createNewInstance" and "saveNewInstance" into the database isn't working as expected!
Offline  
Old 04-06-2009, 01:27 AM   #7 (permalink)
New Member
 
Join Date: Apr 2009
Model: 7100
PIN: N/A
Carrier: airtel
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem FIXED

Hi!

Just to let you know that its working now. My code to copy the contents of the file into the "byte buffer" was screwy.. correcting that made the module load successfully. Thanks again to all the people who replied, have a nice day!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.