Android Question Download and save image from code module

tsteward

Well-Known Member
Licensed User
Longtime User
My app loads some html from a database then sends the html text to a code module to look for my personal markups.
In this case image file names are enclosed with {*image.jpg*} the code module then edits the html text to remove this markup and correctly add the image tags and www path to the html to display this image in a webview.

I would like to download and save the images to prevent continually downloading the same image.

My thoughts were:
Check if file exists locally and if not then download the file. The markup processor would cope with the image file now being local.

My problem seems to be that I can't use "wait" within a code module to wait for the image to be downloaded.

How would you accomplish this?
Any sample code appreciated.

Tony
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top