Android Question Corrupted png files and zip export...

Robert Maguire

Member
Licensed User
Longtime User
I'm well into developing my first B4A app and all was going well until today.

I'm using a sqlite database to store information and one of the tables has a column that stores the file name for an image that is displayed on a panel when the record is selected (I believe that sqlite recommends storing images separately from the database instead of using a blob in the table).

Anyway...the png files are located in the File.DirAssets folder and when I attempt to load them into an ImageView nothing happens. If I look at the files on the device using a file explorer app they have a corrupt symbol displaying. If I copy the files back to a temporary location on the laptop they show also show as corrupted. The original images are fine.

I also tried exporting the project to a zip archive but that produces the following error dialogue message:

"An error occurred. size was 0, but I expected 250880"

Has anyone come across this sort of issue before?

Thanks in advance...
 

Robert Maguire

Member
Licensed User
Longtime User
It always happens...you try everything you can think of and then as soon as you post a question you try something and the problem goes away.

It seems that the problem had to do with loading a layout into a panel. I tried loading it into the activity instead and the image displayed fine (in my app).

The images still do not display when I try to view them with an image viewer on the device and the zip problem still persists so if someone can suggest why that is I would be most grateful.

Cheers
 
Upvote 0

Robert Maguire

Member
Licensed User
Longtime User
Thanks Erel...the problem seems to have disappeared (I hate it when that happens) but I'm not sure why. In any case...I upgraded to 5.2, did a 'clean files folder' and 'clean project' and all seems to be normal. Notwithstanding the panel loading thing I mentioned previously.

The thing I don't understand though is that on my laptop, all the image files are in the Files folder and can be viewed normally.

On my phone (HTC One X) the images are only in the virtual_assets folder and show a ! icon (in ES File Browser). If I try to view them using ES Image Browser then I get a 'Could not load image' view.

I don't quite have the B4A package structure in my brain yet but would I be right in assuming that images in virtual_assests appear corrupt because this is a protected location and the images get copied elsewhere when used by the app?

Thanks
 
Upvote 0

Robert Maguire

Member
Licensed User
Longtime User
Also...the zip problem has disappeared as well. I'd like to know what I did to cause the problem but I'll just accept that it happened and move on...

Cheers
 
Upvote 0
Top