Hi guys~!
I was in the process of loading the resources used by gui from my private server using Live Update. There is too much atlas used by gui (about 1440x800 pixels with more than 100), causing the editor to stop.
So I decided to change the way. As soon as I run apk, I get the resources used by the gui from my private server. Below is a function that loads an image from the server.
function list_image_download(self, list_table)
local image_table = {}
for i = 1, #list_table do
-- 0 is not exist, 1 is exist
if list_table[i].exist == 0 then
http.request(URL .. "images/" .. list_table[i].name, "GET", function(self, _, response)
if response.status >= 200 or response.status < 300 then
local image = image.load(response.response)
if not image then
print(list_table[i].name .. " unable load")
return
end
list_table[i].exist = 1
-- i need a save process ..
else
print("IMAGE RESOURCE LOADING FAILED")
return
end
end, headers)
end
end
end
I succeeded in downloading the image, but could not proceed to the next. Can I save this png file to my phone? In addition, what happens to the saved files when I delete the application? Help me ~~