Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't see pictures saved via getExternalStoragePublicDirectory on PC
    primarykey
    data
    text
    <p><strong>Link to solution/workaround at bottom of question</strong></p> <p>I used the <a href="http://developer.android.com/guide/topics/media/camera.html" rel="nofollow noreferrer">Android tutorial</a> to write code to open the nexus 7 camera via intents and take a photo. It refused to work properly unless I altered the file object initialisation code from </p> <p><code>File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES), "MyCameraApp");</code></p> <p>to</p> <p><code>File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES) + File.separator +"MyCameraApp");</code></p> <p>and even then <code>intent.getData()</code> is still null when <code>onActivityResult</code> is called. Back to the question at hand though: I can see the saved image browsing on the tablet itself, but not when I browse it on the PC via USB. </p> <p>What am I doing wrong? I thought using <code>getExternalStoragePublicDirectory</code> made files completely accessible. Could there be something else wrong with my code? Do I need to somehow "tell" the stock camera app to save it as <code>MODE_WORLD_READABLE</code> or something along those lines?</p> <p>Spent hours and hours trying to get this working properly - any help would be appreciated!</p> <p>I can post the rest of my code if it would help - its almost identical to the <a href="http://developer.android.com/guide/topics/media/camera.html" rel="nofollow noreferrer">Android tutorial</a> though.</p> <p><strong>EDIT:</strong> This is caused by a known problem with the nexus 7 and 4. See 2nd link for solution</p> <p><a href="https://stackoverflow.com/questions/14346160/saving-files-on-external-storage-on-nexus-7-and-retrieving-from-pc?rq=1">Saving files on external storage on Nexus 7 and retrieving from PC</a></p> <p><a href="https://stackoverflow.com/questions/13737261/nexus-4-not-showing-files-via-mtp">Nexus 4 not showing files via MTP</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload