03-28-2011 10:25 AM
I'm busy writing an application for the Blackberry 8520 curve for work. The application will be required to download a data file before use from one of our servers.
How would I go about doing this, not sure where to even start.
Any help will be extremely appreciated.
03-28-2011 04:37 PM
Most web servers will actually supply you the data in any file in any directory that they know about, provided you specify the correct URL. So if the Web Server is running directory myWebServer/baseDirectory on the Server machine, and has a text file in a directory called
Then you can do an http GET for the URL
where www.myserver.com directs the request to your Web Server,
and you will get the txt file.
So all you need at its most basic is standard http GET and knowing the location of the file.
The httpDemo code will do this for you.
Things start getting a little more confusing when you want to download non text files, but we can cross that Bridge when you get to it.
03-31-2011 04:21 PM
Makes sense, however, does what you say apply to a web app or standalone blackberry application. My application is a standalone application installed on the device itself.
Would the procedure be the same? Keeping in mind that the download needs to be completely automated and in the background....the user just needs to set the parameter in the app, and the app will do the rest before the user starts using the app. This will be a once off download until the parameter used is changed again.
03-31-2011 06:32 PM
I was talking about a standalone java apps.
There is an issue with getting data like this before the app starts up, So you need to code your app so that it goes into a known state (say displaying a useful "Please wait while I download my config" screen) until the config is actually downloaded. So I'm not sure you want to download in the background.
But the basic download process is quite straightforward - as I suggested, httpDemo does it, a does the 'GET' processing in the sample:here:
I think it would be useful for you to review both these examples, I think they will fill in some of the gaps in your knowledge and will help you decide how you want to implement this process.