Hmmm. Well, it seems permission were the issue. If I write the images
to the sd card, it now works with everything except Facebook.

Facebook raises a "file not found" exception. No other app (Gmail,
Twitter, etc) has a problem. Anyone else seen this?

I had a look in the source code for the standard Camera app, which
shares fine to Facebook, but I couldn't see that they were doing
anything special.

On Dec 1, 1:31 am, Jason Proctor <[email protected]>
wrote:
> are you using getExternalStorageDirectory() to ensure that your files
> go on the sd card? if you don't qualify the file name, it might well
> go in your app-private area, preventing anyone else seeing it.
>
> failing that, i wonder if Android generally supports the data: URL
> scheme. you might be able to serialise images like this --
>
> data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAA (etc)
>
> ...
>
>
>
> >Hi,
>
> >I'm trying to set up a SEND intent so that my app can share images in
> >a similar way to the gallery app. The only difference is that my
> >images are in memory rather than on the sdcard. This seems to present
> >a conundrum with file system permissions. Any advice appreciated.
>
> >This is how I set up the send intent. All seems to be fine:
>
> >             Uri u = Uri.fromFile(local_file);
> >             Intent intent = new Intent();
> >             intent.setAction(Intent.ACTION_SEND);
> >             String mimeType = "image/jpeg";
> >             intent.setType(mimeType);
> >             intent.putExtra(Intent.EXTRA_STREAM, u);
>
> >The JPEG I want to send is in memory. In order to construct a URI to
> >pass to the send intent, it seems I have to write the JPEG to disk.
> >However, if I write the file to the local files directory of my app
> >using
>
> >openFileOutput("image.jpg",MODE_WORLD_READABLE);
>
> >then the activity that accepts the send request has an error when it
> >tries to fetch this image. I think this is because it doesn't have
> >read permissions on my local storage. And there is no apparent way to
> >give it the necessary permissions.
>
> >So that seems to leave writing the image to the sdcard. Is this
> >correct, or did I miss a trick somewhere? Using the sdcard as temp
> >storage seems like a messy solution.
>
> >Best,
> >Mark
>
> >--
> >You received this message because you are subscribed to the Google
> >Groups "Android Developers" group.
> >To post to this group, send email to [email protected]
> >To unsubscribe from this group, send email to
> >[email protected]
> >For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> jason.vp.engineering.particle

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to