11-13-2008 09:46 PM
Working on some code to check for the presence of images as resources, or on the file system. I'm noticing, however, that Image.createImage("/someResourceImageName") is really slow to fail.
Is there a fast way to check for the presence of a resource? Alternatively, is it possible to get a list of available resources? (Really these are general Java questions to which I should already know the answer.... :/)
Thanks in advance!
11-21-2008 02:05 PM
This should fail rather quickly when accessing images within a cod file. What BlackBerry model and handheld software version are you testing on? You can find this under Options, About on the BlackBerry handheld.
If you want to check for images in the file system you can use a FileConnection and search for files with image extensions.
11-26-2008 11:36 PM
AT&T 8820 and Verizion 8830 (Curve). It's definitely way slow on both handsets
Is there a FileConnection.exists() method for resources? This would solve my problem I think.
12-03-2008 09:43 AM
The link below has sample code on reading resources directly. This may thrown a NullPointerException quicker.
How To - Add plain text or binary files to an application
Article Number: DB-00148
However, there shouldn't be a delay in the createImage call. What version of BlackBerry handheld software are you testing on?
12-05-2008 12:53 PM
8820 = v22.214.171.124 (Platform 126.96.36.199)
8330 = v188.8.131.52 (Platform 184.108.40.206)
Thanks for the tip. I'll try to find some time to test directly reading the resources.