1

I'm making a program for termux and i need to access to the home directory(where are the Downloads, Android, DCIM, etc directories).

The problem is that i know that not all the phones have the '/storage/emulated/0', for example an old phone of mine had '/sdcard' instead

Any help is appreciated :)

3
  • The answer is it depends on the phone... There is no real "home" directory like Linux, but kind of, and in some devices it's /sdcard, others /storage/emulated/0, and in many /sdcard is just a link to the storage path (my Pixel for example). I think almost all phones have /sdcard as a link to the correct location for compatibility with older apps, but I don't know how long that will continue to exist, maybe a long time maybe not... Google is fickle.
    – acejavelin
    Commented May 14, 2021 at 14:49
  • 1
    /data/data/com.termux/files/home or $(realpath $EXTERNAL_STORAGE)?
    – alecxs
    Commented May 14, 2021 at 14:59
  • 1
    Read (completely and patiently) my answers to Is it reliable to save some app files in /storage/emulated/0/? and What is /storage/emulated/0/?. Commented May 14, 2021 at 15:24

0

You must log in to answer this question.

Browse other questions tagged .