How to write file into DCIM directory exactly where camera does?

后端 未结 5 509
暖寄归人
暖寄归人 2021-01-20 19:14

Suppose I am writing an alternative Camera application and wish to write images exactly into the same place as Camera does and name them exactly in the same name Camera does

5条回答
  •  清酒与你
    2021-01-20 19:41

    How would I accomplish this?

    Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + File.separator + "You Dir. Name";
    

    if you append any string to end this

    Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)

    it will create dir inside the folder

    How to know the location of camera files?

    By default camera uses this location

    Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)

    How to know current naming convention?

    IMG_yyyyMMDD_timeStamp

    How to gain permissions to that directory?

    Using permission manager for Camera and External Storage permissions

提交回复
热议问题