So I am creating a puzzle game, and each puzzle is created from data within an SQLite file. These files are hosted on my server. In the simulator everything works fine and the files get downloaded, however, on my Android device it does not work. I haven’t tested this on an iOS device yet.
Here is the download code:
local function downloadFile() local function networkListener( event ) if ( event.isError ) then print( "Network error - download failed" ) print("status in isError: " .. event.status) print("response in isError: " .. event.response) elseif ( event.phase == "began" ) then print( "Progress Phase: began") print("status in began: " .. event.status) print("response in began: " .. event.response) elseif ( event.phase == "ended" ) then print( "download successful" ) print("status in ended: " .. event.status) print("response in ened: " .. event.response) storyboard.gotoScene("scene-DailyGame") end end local params = {} params.progress = true if fileExists(myG.selectedDailyPuzzle, system.TemporaryDirectory) then print("file exists") storyboard.gotoScene("scene-DailyGame") else network.download( "http://www.myserverinfo.com/" .. myG.selectedDailyPuzzle, "GET", networkListener, params, myG.selectedDailyPuzzle, system.TemporaryDirectory ) end end
And this is what the logcat is showing me:
I/Corona ( 2625): Progress Phase: began I/Corona ( 2625): status in began: 200 I/Corona ( 2625): Network error - download failed I/Corona ( 2625): status in isError: 200
I thought 200 meant the file downloaded successfully? Why is it reverting to the isError state?