- there is a function to detect whether file is on local
function FileUtil:doesFileExist( fname, path )
local results = false
local filePath = system.pathForFile( fname, path )
if filePath then
filePath = io.open( filePath, “r” )
end
if filePath then
– Clean up our file handles
filePath:close()
results = true
end
if results == false then
LOG(“FileUtil:doesFileExist: “…fname…” not on local”)
end
return results
end
fname = xxxx
if FileUtil:doesFileExist( “res/ui/store_item/”…fname, system.ResourceDirectory ) == true then
xxxx
end
Actually we have included files in the apk, but when call FileUtil:doesFileExist, it could not find the files on local.
- same issues when system.openURL(system.pathForFile(“help.html”, system.ResourceDirectory))
I’m using enterprise version 2015.2574.
Run in the real android device.
What’s the wrong?