1

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

FaisalAhmed
  • 3,469
  • 7
  • 46
  • 76
  • You should do google for this and you will get better idea , here just post questions logically for solutions. By the way check this link : http://gadgetstouse.com/gadget-tech/internal-phone-external-storage/20812 – Vickyexpert Jul 02 '16 at 09:59

2 Answers2

2

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");
Tobias Uhmann
  • 2,757
  • 2
  • 25
  • 35
  • can i store image using internalStorage method . that can be accessed by user ? – FaisalAhmed Jul 02 '16 at 10:25
  • No. The internal storage is meant not to be accessible by users or other apps. While there was a possibility to share files on internal storage with other apps, even that won't be possible beginning with N anymore. – Tobias Uhmann Jul 02 '16 at 10:29
0

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

manichandra
  • 156
  • 1
  • 3