I'm trying to update my app(s) but the database is huge.
So, I thought that I can zip it, then download it, then extract it to the actual file on the device.
But it didn't work.
App freezes trying to unzip the file.
Here is my code:
Code: Select all
on doTheUpdate
if checkConnection() then
put "http://www.example.com/myDatabase.zip" into theSource
put specialFolderPath("documents") & "/database_temp.zip" into theTempFile
put specialFolderPath("documents") & "/actualDatabase.sqlite" into theTarget
libUrlDownloadToFile theSource, theTempFile
if ((there is a file theTempFile) and (calcTheFileSize(specialFolderPath("documents"), "database_temp.zip") > 0)) then
revZipExtractItemToFile theTempFile, "actualDatabase.sqlite", theTarget
answer the result
/* no result whatsoever, it just freezes, black screen */
delete file theTempFile
end if
end if
end doTheUpdate
Regards,
~ Ender Nafi Elekcioglu