https://developer.android.com/training/camera/photobasics.html
I followed example of Google but using:
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
I have my photo in Picture folder but my device do save an other copy of the photo in DCIM folder (with different timestamp). eg: i got a photo My_prefix_20180122_171255.jpg in Picture and an other IMG_20180122_171300.jpg in DCIM. How to avoid this?
(Tested on Android 4.4, Android 6.0.)
Thanks.
i got a photo My_prefix_20180122_171255.jpg in Picture and an other IMG_20180122_171300.jpg in DCIM
That behavior will vary by camera app. There are hundreds of camera apps, both pre-installed on devices and available for users to install via the Play Store and elsewhere.
How to avoid this?
Do not use a third-party camera app to take the picture. Take it yourself, either by using the camera APIs directly, or by using a third-party camera library (e.g., Fotoapparat, CameraKit-Android).