how to save capture image in sdcard?

后端 未结 6 2061
旧巷少年郎
旧巷少年郎 2021-01-27 11:19

I want to use default camera and capture image. i want save image in sdcard/photofolder/ and save filename as curenttime format in sdcard/photofolder/ also display capture imag

6条回答
  •  面向向阳花
    2021-01-27 11:37

    You can get SDCard path like..

    String root = Environment.getExternalStorageDirectory().toString();
    
    new File(root + "/photofolder").mkdirs();
    

    Then you can save a file to root + "/photofolder/20120830025700.jpg".


    Have you requested permission to write onto SD card? Add the following string to you app manifest:

     
    

提交回复
热议问题