Or you can just explicitly ask the media scanner to scan the file:

http://developer.android.com/reference/android/media/MediaScannerConnection.html

On Mon, Nov 23, 2009 at 8:49 AM, Streets Of Boston
<[email protected]>wrote:

> If you do a ContentResolver.insert, instead of a
> MediaStore.Images.Media.insertImage, you have to provide the fully
> qualified path to the image-file in the ContentValues as well:
>
>   // fullyQualifiedPathName is the absolute/canonical path-name to
> the JPEG file.
>   values.put(MediaStore.Images.Media.DATA, fullyQualifiedPathName);
>
> And you should call bitmap.compress on the FileOutputStream of this
> JPEG file to save the actual image/jpeg data.
>
> If you don't do this, the MediaScanner will pick it up, but only after
> you unmounted your sd-card or restarted your  phone.
>
>
> On Nov 22, 6:04 pm, Derek <[email protected]> wrote:
> > Agree we are seeing the same thing.  Haven't found any solution yet.
> > In Sense UI seems like HTC wrote their own camera app that is
> > listening to the same intent as the default Android camera but not
> > conforming to the same interface contract as the Android code.
> >
> > Anyone else find a fix to this?
> >
> > On Nov 5, 6:27 am, SCMSoft <[email protected]> wrote:
> >
> >
> >
> > > (The message was accidentally sent, here is the full one:)
> >
> > > Hi,
> > > We have multiple apps that save pictures to the phone. We use the
> > > following code for that:
> >
> > >         ContentValues values = new ContentValues();
> > >         values.put(MediaStore.Images.Media.DISPLAY_NAME, "Photo");
> > >         values.put(MediaStore.Images.Media.DESCRIPTION, "Camera
> > > Pro");
> > >         values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
> > >         values.put(MediaStore.Images.Media.DATE_TAKEN,
> > > System.currentTimeMillis());
> > >         Uri uri = getContentResolver().insert
> > > (MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
> >
> > >         ... save Image to getContentResolver().openOutputStream
> > > (uri) ...
> >
> > > This works fine on the G1 and a Samsung Galaxy, but on HTC phones with
> > > thesenseUI, the photos seem to be stored in a different location.
> > > The HTC "Albums" app doesn't pick these photos up and to the user it
> > > seems like the photos are not there at all. Also the default gallery
> > > app is not present.
> > > Is there a way to save images in the "right place" always? Can any
> > > phone manufacturer just choose to shuffle things around like this? It
> > > seems to make it unnecesarily hard on app developers if there are no
> > > standards.
> >
> > > Best regards,
> >
> > > Swiss Codemonkey team.- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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