There are far too many variables in this situation to be definitive but here’s what CoronaSDK does and perhaps you can map that to your app …
A Lua statement like this:
local filePath = system.pathForFile( "data.txt", system.DocumentsDirectory )
will result in the file being located at this path on the Android device (obviously the package name will vary):
/data/data/com.coronalabs.test.FileDemo/app\_data/data.txt
Note that this is not the same as the location returned by android.content.Context.getFilesDir() as might be used in a native Android app (if that’s what your old app is using) which would be something like:
/data/data/com.coronalabs.test.FileDemo/files/data.txt
Once you know the full path of the file in old app, you should be able to access it in the CoronaSDK app using code like this:
local packageName = system.getInfo( "androidAppPackageName") or "PACKAGE\_NAME" local testfileName = "/data/data/"..packageName.."/files/data.txt" local testfile = io.open( testfileName, "r" ) if testfile then -- read all contents of file into a string local contents = testfile:read( "\*a" ) print( "Contents of " .. testfileName ) print( contents ) io.close( testfile ) else print( "ERROR: cannot open ", testfileName) end
But as I mentioned at the start, there are many variables here (behavior might vary between different versions of Android for instance) so we can’t support code like this. Good luck!