Here is a snippet of code to use the MediaStore to save a picture file to
the gallery using MediaStore.
File "123.jpg" is opened as File myPicture. MyPicture for MediaStore Seems
like there should be more to it, but this works for me.
Carmen
http://www.talkingandroid.com
File myPicture=new
File(Environment.getExternalStorageDirectory(),"123.jpg");
if (myPicture.exists()) {
System.out.println("Photo file exists");
String uriString;
try {
uriString =
MediaStore.Images.Media.insertImage(getContentResolver(),
myPicture.getPath(), "title", "description");
Uri uri = Uri.parse(uriString);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
On Wed, Aug 19, 2009 at 12:38 PM, Mark Murphy <[email protected]>wrote:
>
> jbrohan wrote:
> > I'm working through Mark Murphy's excellent books at commonsware.com.
>
> Thanks!
>
> > The camera application takes pictures nicely but they don't appear in
> > the Gallery , nor can I attach them to emails.
>
> In terms of the Gallery, I believe that is handled via the MediaStore:
>
> http://developer.android.com/reference/android/provider/MediaStore.html
>
> However, I haven't used it.
>
> In terms of emails, if you are referring to sending the emails yourself
> programmatically, this should work:
>
>
> http://stackoverflow.com/questions/587917/trying-to-attach-a-file-from-sd-card-to-email
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Looking for Android opportunities? http://wiki.andmob.org/hado
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---