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: 111
Registered: ‎10-01-2009
My Device: Not Specified
Accepted Solution

Download Multiple Files

I have been searching and have found info on downloading large files (download combiner), single zipped/compressed files, and adding files and resources directly to a project.  My question is about downloading additional resources separately. For example, after logging in, I would like the application to download a xml settings file, plus an optional collection of images, etc. I understand how to download them individually, but I am not sure how to download them all at once. I guess if the resources were zipped and there was a good library for decompressing I could use that,  although peter_strange says there is a problem with the only thing I have found on the forums, called ZipMe. (http://supportforums.blackberry.com/t5/Java-Development/How-to-extract-a-ZIP-file-incl-folder-struct...)

However I'm not as concerned about compressing the data as I am about combining it into a single file or single download.  Anyone have any suggestions?

 

Thanks for any input.

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

Re: Download Multiple Files

what is wrong about downloading it one by one?

----------------------------------------------------------
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: 111
Registered: ‎10-01-2009
My Device: Not Specified

Re: Download Multiple Files

If i have 60 small images ... wouldn't i have to be making 60 http connections to each individual file, as opposed to a single connection to one file? I would assume that would be a lot of extra work.  Also, as opposed to just periodically downloading an updated images.zip file, i would have to know the names of all the files.  Unless there is a much better way im not thinking of.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Download Multiple Files

I had problems with ZIPMe, other people have reported it working.  It might have just been me.  You could give it a try.

 

If you do, do NOT compress the files.  Then it might work.  The issue I had was with large compressed files.  If you are not bothered about compressing then ZIP might be a good packaging method. 

 

Other than that, you could write a tar implementation?

 

There is no provided BlackBerry packaging implementation. 

Developer
Posts: 111
Registered: ‎10-01-2009
My Device: Not Specified

Re: Download Multiple Files

As long as the files do not need to be compressed, tar seems to be the way to go. I did a quick test using the j2metar library and it seems to extract files on the sdcard fine. Thanks !

 

http://code.google.com/p/j2metar/

Developer
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi

Re: Download Multiple Files

Thanks jd15

 

I have download the j2metar code and create an example for blackberry

 

http://supportforums.blackberry.com/t5/Java-Development/How-to-compress-a-folder/m-p/601626#M125024

Highlighted
Developer
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi

Re: Download Multiple Files

To get support of zip format in blackberry for mulitple files and folders

Please use the following source code

 

 

http://code.google.com/p/staff/downloads/detail?name=jazzlib-j2me-src-0.0.7.zip&can=2&q=jazzlib-j2me