Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

external-internal storage

Tags:

android

In android, whats the difference between external storage that is nonremovable (internal) and the internal storage? I am not sure where to save my data. I just need to save a game stats that a person can pull anytime they want

Thank you

like image 522
Snake Avatar asked Jun 26 '12 17:06

Snake


People also ask

What is external storage and internal storage?

In short, Internal Storage is for apps to save sensitive data to which other apps and users cannot access. However, Primary External Storage is part of built-in storage which can be accessed (for read-write) by the user and other apps but with permissions.

Which is better internal storage or external storage?

External drives are ideal for raw storage space and transportation of files. Internal drives are suitable for frequent file access and speed, especially with gaming. External drives can also be easier to repair and have a higher storage cap, while internal drives can hold up better and last longer.

What is internal storage?

Android Internal storage is the storage of the private data on the device memory. By default, saving and loading files to the internal storage are private to the application and other applications will not have access to these files.

What does external storage mean in Android?

External Storage:This can be a removable storage media (such as an SD card) or an internal (non-removable) storage. That means, both storage types like Nexus 6P's 64 GB internal memory and removable microSD card which we insert in phone's card slot are considered as External Storage.


1 Answers

In many newer devices there will no longer be a physical distinction, with "internal" and "external" storage sharing the same flash chips without necessarily even having fixed allocation, so the difference really remains one of intended access paradigm.

Files on the external storage (real or simulated) are unavoidably shared with everything, and modifiable by anything with that manifest permission. Traditionally they are easily visible, though with the recent MTP-access devices the system may need to be told about them before a connected PC will see them.

In contrast, files on the internal storage are private to an application, excepting anything running as root or system, or if the application has decided to make them generally visible or changeable. Even when accessible, data on the internal storage can be more difficult to access outside the owning app - it's not supported by the consumer-targeted USB Mass Storage or MTP mechanisms, and even for other apps and development tools it is tricky to locate unless you know where to look, as while you may be able to examine files folders which applications have chosen to share, you cannot browse through the parent (typically /data or /data/app) folders. It can be a bit frustrating even for the developer of an app to access the files it creates on private storage during debugging (though while the apk is debuggable it is possible with the run-as tool and adb, or you can build an export capability in to the app, or run on the emulator where adb has root).

Likely your decisions process should be something like this: Is it meant to be private to the owning application? If so, put it on the internal storage, unless it's too big and targeted at older devices, in which case you may need to encrypt and/or sign it for protection before placing on the external storage. Otherwise, if it's meant to be shared, needs to be handed to arbitrary other components (email app, etc), or is big, put it on the external storage.

like image 143
Chris Stratton Avatar answered Oct 07 '22 17:10

Chris Stratton