Monday, August 1, 2011

[android-developers] ACTION_SEND Image from Memory?

Hi All,

Is it possible to create an ACTION_SEND Intent and ContentProvider to
send a compressed image directly from memory?

I want to avoid having to the save the image to the SD card and then
sharing it via its URI. Instead I would like to write a
ContentProvider and have the image data be return as a Stream or
Blob.

Here's an abbreviation of what I have so far:
public class ImageContentProvider extends ContentProvider
{
........
@Override
public AssetFileDescriptor openAssetFile( Uri uri, String mode )
throws FileNotFoundException
{
............ // this gets called when trying to gmail an image - any
way to do this without a saved file????
}

@Override
public Cursor query( Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder )
{
return new ImageCursor();
}

......
class ImageCursor extends AbstractCursor
{
....
@Override
public String[] getColumnNames()
{
return new String[] { Images.ImageColumns.DISPLAY_NAME,
Images.ImageColumns.SIZE };
}

@Override
public byte[] getBlob( int column )
{
// this never gets called - any way to use
this instead of openAssetFile()???
}
..........

}


Any ideas??
Thanks!
Chad

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

No comments:

Post a Comment