T Toon New Member Licensed User Longtime User Sep 12, 2012 #1 I tested around a bit with those very easy to access but sometimes unreliable Wi-Fi connections. The problem I encountered with my app (downloads images from the internet and stores them on the SD) is that when the download-process is interrupted, sometimes the images are downloaded but not valid/viewable. Is there a way to see if an external is valid before loading it with LoadBitmap (which returns an error if the previously described problem happens)? *I don't mean just check if the file exists, I know how to do that.
I tested around a bit with those very easy to access but sometimes unreliable Wi-Fi connections. The problem I encountered with my app (downloads images from the internet and stores them on the SD) is that when the download-process is interrupted, sometimes the images are downloaded but not valid/viewable. Is there a way to see if an external is valid before loading it with LoadBitmap (which returns an error if the previously described problem happens)? *I don't mean just check if the file exists, I know how to do that.
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2012 #2 Are you using HttpUtils2? Are you checking Job.Success flag? Upvote 0
thedesolatesoul Expert Licensed User Longtime User Sep 12, 2012 #3 You can use Try...Catch. Code: Try bmp = LoadBitmap(a,b) Catch MsgBox("Failed to load bitmap","Sorry") End Try Upvote 0
You can use Try...Catch. Code: Try bmp = LoadBitmap(a,b) Catch MsgBox("Failed to load bitmap","Sorry") End Try