I have a game which loads simple libraries which are .txt format files (they are quite large in length, but simple in format so I am simply parsing them by line).
They exist in an organized fashion in a directory within the system.ResourceDirectory. The exact code I am using works in all simulations, as well as on iOS.
I am aware that on android the above directory does not exist in reality, but an aforementioned post stated that the apk file is essentially a zip wherein corona provides the necessary files when called.
I’m hoping that there is some android specific permission I have overlooked, or something similar. I have seen several other threads with issues like this, but none with a solution.
Here is a code snippet for how I am loading the file (though like I said this works in all other circumstances, just not on the device):
local function loadDictionary() print("Reading dictionary...") local path = system.pathForFile( "libraries/wetlands/level1.txt", system.ResourceDirectory ) local file, errStr = io.open( path, "r" ) if file then local ctr = 0 for line in file:lines() do dict[line] = true ctr = ctr + 1 end io.close( file ) print("Dictionary loaded. Words found: ".. tostring(ctr)) else print( "Reason open failed: " .. errStr ) end file = nil end