views:

33

answers:

1

Hi, I have a BlackBerry app that, when installed, needs to also copy over some files(.htm, css, images).

How is this done? Is it some attributes that need to be defined in the .alx or .jad files?

A: 

Installing your app only adds modules to the device - you can't create arbitrary files in the file system (at least during install time). There are a few ways you could accomplish what you need:

  1. When the app first starts up, create files on the filesystem from resources compiled into your COD. This would work well as long as your files aren't too big (you want to try to avoid bloating your COD file if possible).

  2. When the app first starts up, download the required files over HTTP and copy them into the filesystem.

Marc Novakowski
Hi Thanks Marc! I managed to do it via the first method. I was wondering if you could point me in the right direction for method 2? Which class should i be looking at?
Ridz
The simple answer is to use Connector.open() - the "real" answer is that it's not that simple! Check out this forum sticky for a summary of all the intricacies of doing HTTP in a BlackBerry app: http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-connections-to-the/td-p/206242
Marc Novakowski
ho ho ho! Thanks Marc. Sounds like something that's going to be problematic when dealing with the difference between a device that runs on the BIS vs BES. I'll go through those links...Thanks again!
Ridz