FaisalAhmed
FaisalAhmed

Reputation: 3651

Can anyone tell me about InternalStorage in Android ? I am confused

I am new to android . I have little confusion on internal storage topic in android. Please correct me if i am worng

InternalStorage :- Allows us to read and write file that are associated with each application's internal memory so the data are private to your app. This file can only be accessed by the application and cannot be accessed by other application or users

Is it true that InternalStorage store data in device internal memory ? If answer is yes then how can i store images ,videos etc that user can see and access it on device or by pc when they are connected through usb?

if my app downloads an image and device does not have sdcard and i have used internalstorage method in this condition how user can see dowloaded image using usb or from device ?

It will be good if explanation is given with example .Thanks in advance

Upvotes: 1

Views: 162

Answers (2)

Tobias Uhmann
Tobias Uhmann

Reputation: 3057

You must save your files on external storage. Notice that external storage does not automatically mean removable storage. Normally the devices built-in storage is divided into internal and external storage. However, external storage also includes removable storage like SD cards.

So, if you want to save files that the user should be able to access for example with his PC you should save to the external storage.

The respective user guides on that topic are in particular:

For example, if you want to save a picture that is accessible by the user in the expected directory you would use

File picture = new File(Environment.getExternalStoragePublicDirectory(
        Environment.DIRECTORY_PICTURES), "filename.png");

Upvotes: 2

manichandra
manichandra

Reputation: 156

Since API level 17, MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE are deprecated in internal storage method.so, you cannot write a file that can be accessed by user using internal storage method. try External Storage to write file so that you can access.for more

https://developer.android.com/guide/topics/data/data-storage.html

Upvotes: 0

Related Questions