2

I have make an app in android in which an image is taken from the default camera and retrieve it from DCIM/Camera folder to show it in an Image View.My question is- Is DCIM/Camera folder exists in all devices? because if any device doesn't store the capture image in DCIM/Camera folder,the image will not show in the image view.Please answer my Question. Thanks in advance..

Deepak Sharma
  • 4,999
  • 5
  • 51
  • 61

1 Answers1

2

The short answer is NO. You cannot trust the system to put the captured image in DCIM/Camera.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • Thanks Alex..So please guide me where i should store the captured image? – Deepak Sharma Nov 15 '12 at 12:30
  • If you are responsible for saving the image to file, you may put it wherever you choose, (including **the Cloud** if you wish). If you are looking for the result of default camera capture, you can choose location, see http://stackoverflow.com/questions/3442462/how-to-capture-an-image-and-store-it-with-the-native-android-camera. More in Android developers tutorial: http://developer.android.com/training/camera/photobasics.html – Alex Cohn Nov 15 '12 at 12:32
  • Thanks Alex for your fast reply..But this code is not working fine in Motorola devices.. Uri outputFileUri = Uri.fromFile(sdImageMainDirectory); intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); – Deepak Sharma Nov 15 '12 at 12:41
  • Application get force close after capturing the image when try to save it. – Deepak Sharma Nov 15 '12 at 12:42
  • Have you arranged for external storage write permission? – Alex Cohn Nov 15 '12 at 13:45
  • Yeah Alex..In all the devices the above code is working fine but it creates problem only in Motorlola Droid Razzr.. – Deepak Sharma Nov 20 '12 at 09:28
  • Unfortunately, there are many other devices that don't implement EXTRA_OUTPUT, see http://stackoverflow.com/questions/1910608/android-action-image-capture-intent – Alex Cohn Nov 20 '12 at 13:28