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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to