Search code examples
javaandroidfilecamerasave

Can't find the location of .jpg files created by an app


I'm completely new to android development and not very experienced when it comes to programming in general and I've been fiddling around with a photo-taking app described in a tutorial which can be found at https://androidkennel.org/android-camera-access-tutorial/. It works fine but I can't seem to find the photos taken by the app anywhere in my phone's file system so I'm not sure if they're actually being saved or not. Could someone explain how it works to me?


Solution

  • As blackapps mentions in the comments:

    Quote from your link:

    File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(
                Environment.DIRECTORY_PICTURES), "CameraDemo");
     
    if (!mediaStorageDir.exists()){
        if (!mediaStorageDir.mkdirs()){
            return null;
        }
    }
    

    That tells you the path. Every filemager can show that path. '..../Pictures/CameraDemo. You (or de code) are already doing that by making it visible by putting it in an ImageView:

    if (resultCode == RESULT_OK) {
         imageView.setImageURI(file);
    }