Home » Android » Where is the temp folder on Android devices?

Where is the temp folder on Android devices?

Posted by: admin April 23, 2020 Leave a comment

Questions:

Where is the temp folder located on Android phones?

How to&Answers:

Reading this post from the android developers google group leads me to believe that there is not 1 global temp directory, and each application is expected to maintain their own temporary files.

Answer:

The temporary directory is /data/local/tmp.

I’ve seen some comments that claim you need to be rooted to access it but I’m not sure that’s true. Whilst it is true that you need root to freely access /data, this is not required for /data/local/tmp.

I have verified this on Android 5.1.1.

Answer:

I believe what you’re looking for is getCacheDir()!