BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Developer Forum (http://www.blackberryforums.com/forumdisplay.php?f=15)
-   -   Distribute data with application (http://www.blackberryforums.com/showthread.php?t=122152)

radski 03-25-2008 04:50 PM

Distribute data with application
 
Hello,

excuse my newbie and hopefully trivial question.

What's the best way to distribute large chunks of structured textual data (think plain text CSV files, tables or xml etc.) with a BB application that 4.1 and earlier compatible? Do it in code? This would mean an app recompile with every new version of the data set - not a big issue - but isn't there some more efficient way of doing this?

Thanks,

R.

simon.hain 03-26-2008 03:41 AM

how would you read the data in? the bigger your data are the better would be a kind of compression, maybe using the zip-algorithm some company implemented a few weeks ago.

radski 03-26-2008 03:59 AM

Indeed, that's part of my question, compression would obviously be suitable for large sets of lexical data, but that's veering off the original question.

Is there anybody who implemented a dictionary or something similar? My app is not that different from that.

richard.puckett 03-26-2008 10:08 AM

Is there a reason that you need to ship the data with your app? When I hear "strutured" I think XML (I'm one of those people who actually like XML). Could you not host your data on a web server somewhere and download it to your app over http? Pull it down as part of an initialization process and then periodically check for updates.

radski 03-26-2008 04:17 PM

Just a simple text file(?)
 
Hello Richard,

thanks for the reply, I too like structured data (sorry to say, I'm not a massive fan of XML for its bulk and lack of readability).

I'd like to avoid live data transfers, some people still get charged per MB, and the data is sufficiently static to warrant a reinstall when they do get updated. In my opinion it also makes it easier to distribute the app (something about fewer moving parts...)

So any takers on how to bundle up data into the project? I can almost see end is nigh for MyTextAndData.java :razz:

radski

richard.puckett 03-26-2008 05:11 PM

I'm certainly a fan of having fewer moving parts as long as that really does keep the app simpler (and what with all the issues related to BlackBerry networking that might just be the case here).

So if you want to distribute data with the app you could put your data files into a resources folder (for convenience) and include those files on your rapc command line. Then, in code, use Class.getResourceAsStream(String) to get an InputStream. This is how I handle shipping configuration information in my apps.

lionscribe 04-09-2008 07:31 AM

Wirelessly posted

Quote:

Originally Posted by richard.puckett
I'm certainly a fan of having fewer moving parts as long as that really does keep the app simpler (and what with all the issues related to BlackBerry networking that might just be the case here).

So if you want to distribute data with the app you could put your data files into a resources folder (for convenience) and include those files on your rapc command line. Then, in code, use Class.getResourceAsStream(String) to get an InputStream. This is how I handle shipping configuration information in my apps.

I would do as Richard advises, but I would compile it separately as a library, thus having 2 cod files. Then when you have to update, you only update the library, thus avoiding a complete reinstall with a possible reset.
Lionscribe


All times are GMT -5. The time now is 06:17 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.