External Internal Storage

In android, what is the difference between external storage that cannot be eliminated (internal) and internal storage? I am not sure where to save my data. I just need to keep the statistics of the game, which a person can pull out at any time when he wants

thanks

+6
source share
3 answers

Many new devices will no longer have a physical difference, while the “internal” and “external” storage will use the same flash chips, not necessarily having a fixed distribution, so the difference really remains one of the intended access paradigms.

Files on external storage (real or simulated) will inevitably be distributed throughout and can be modified using any resolution of this manifest. Traditionally, they are easily visible, although with the latest MTP access devices, the system may need to talk about them before the connected computer sees them.

In contrast, files on internal storage are private to the application, with the exception of anything running as root or system, or if the application decided to make them generally visible or mutable. Even when accessing data, data on the internal storage may be more difficult to access outside your own application - it is not supported by USB Mass Storage or MTP target devices that are consumer-oriented, and even for other applications and development tools it’s hard to find if you don’t You know where to look, because while you can browse folders with files that were selected for applications, you cannot browse folders of a parent (usually / data or data / application). It can be a little frustrating even the developer of the application to access the files that he creates in the private storage during debugging (although, although apk is being debugged, this is possible using the run-as and adb tools, or you can create export options to the application or run on emulator where adb has root).

Your decision-making process should probably be something like this: should it be the private owner of the application? If so, put it in the internal storage if it is too large and not intended for older devices, in which case you may need to encrypt and / or sign it for protection before placing it on the external storage. Otherwise, if it is intended for sharing, it must be transferred to arbitrary other components (email application, etc.) Or large, put it on an external storage.

+13
source

In android, what's the difference between external memory which is non-removable (internal) and internal memory?

External storage was never intended to be deleted. It always meant "accessible to the user by plugging in a USB cable and installing it as a disk on the host computer." Early Android devices had removable external storage, but this was never a definition.

Internal storage is storage that is not accessible to the user, with the exception of installed applications (or by rooting their device).

+7
source

In response to Chris’s answer, if you are worried about external storage (SD card) without being avilable, you can simply check this every time your application loads, and then retrieve the troubleshooting information accordingly.

You can use something like this:

if(isSDPresent) { // SD Card is present // Your code goes here, files will be located @ /mnt/sdcard/Android/data/packagename } else { // SD Card is not presenet // files located here /data/data/packagename } 

If you are testing an emulator, you can download your DDMS and find all the files stored in places of rest.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/919057/


All Articles