system.TemporaryDirectory in Android?

Does anyone know how to access Corona’s system.TemporaryDirectory in Android/java? I’m not sure where this directory is located.

For example, if I create a new file in Corona:

local saveData = "My app state data" local path = system.pathForFile( "myfile.txt", system.TemporaryDirectory ) local file = io.open( path, "w" ) file:write( saveData ) io.close( file )

And I am using the following code on the Android/java side to access that file:

File src = new File(DIRECTORY, "myfile.txt");

What would DIRECTORY be?

You can fetch Corona’s directory paths via the Java “com.ansca.corona.CoronaEnvironment” class.  Have a look here…

   https://docs.coronalabs.com/daily/native/android/html/com/ansca/corona/CoronaEnvironment.html#getTemporaryDirectory(android.content.Context

You can fetch Corona’s directory paths via the Java “com.ansca.corona.CoronaEnvironment” class.  Have a look here…

   https://docs.coronalabs.com/daily/native/android/html/com/ansca/corona/CoronaEnvironment.html#getTemporaryDirectory(android.content.Context