0

Android ver 4.3, API 18, Nexus 4

I am trying to save some recorded video files in a specified location. I am using:

File mediaStorage = new    File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "DirName");

This works fine, but when I try to use the DIRECTORY_PICTURES location instead, as the android developer docs recommend (http://developer.android.com/guide/topics/media/camera.html#saving-media), it doesn't exist.

Anyone know why?

RodPValley
  • 29
  • 1
  • 5

3 Answers3

0

The file exists. But you cannot see in albums if this is not image file. You can see in /sdcard/pictures. Please check it

Dragan
  • 328
  • 2
  • 12
0

Pictures and DCIM are two separate directory. the first is located at sdcard:/Picture , the second is at sdcard:/DCIM. I suggest to save your record to sdcard:/Picture/YOURAPPNAME/ (use mkdirs() to create this directory) and add this to your manifest :

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Remember to call the media scanner after you have saved your file, so it can be displayed on the gallery. Hope this helps

RodPValley
  • 29
  • 1
  • 5
Luca D'Amico
  • 3,192
  • 2
  • 26
  • 38
-1

File mediaStorageDir = new File(Environmet.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),IMAGE_DIRECTORY_NAME);

And Declare IMAGE_DIRECTORY_NAME in your code...

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
piya
  • 1