Thank you for you answer. I've added the additional parameter to the
values and this works now. But the problem with the restart and the
lose of meta information is still there. At the moment I am recording
something and the meta information is added to the database which can
be seen in the music app. But after restarting the emulator the meta
information is gone and I dont really know why.

Regards!

On 8 Sep., 23:09, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> You need to add this to the contentvalues:
>
> values.put(MediaStore.Audio.Media.IS_MUSIC, "1");
>
> if you want the newly added files to appear in the Album, Artists sections
> of the Music app.
>
> 2008/9/8 code_android_festival_way <[EMAIL PROTECTED]>
>
>
>
> > I got a problem with the audio recording. I am able to record audio
> > and play the recorded file with the music app.
>
> > This looks like this:
>
> >http://img.skitch.com/20080908-m5yaiyqh7jugcub5p5pmmna2ee.jpg
>
> > You can see that the meta information is available. But the only point
> > where the audio file shows up is in the recently added music playlist.
> > In the artist or album section I cant find anything.
>
> > Now I'm restarting the emulator and get the following result in the
> > music app:
>
> >http://img.skitch.com/20080908-825exr6mcqt82dm2idkwpwa7xh.jpg
>
> > You can see that the recorded file is showing up now in the Artist
> > column but without the meta information. I am able to play the file
> > which looks like this:
>
> >http://img.skitch.com/20080908-jsgf8yghnkdg8241rsqyweje78.jpg
>
> > But even there the meta information is lost.
>
> > Here is my code for adding the values:
>
> >http://paste.pocoo.org/show/fMHzaLRCwEG49qAkpvYh/
>
> > Here is my code for recording:
>
> >http://paste.pocoo.org/show/P6UWFE2rtj0qIB1dh9vQ/
>
> > So I dont really know what I'm doing wrong here.
>
> > I'm really looking forward getting some kind of help from you.
>
> > Regards!
>
> > 09-08 11:09:29.035: ERROR/MediaPlayerService(25): Couldn't open fd for
> > content://media/external/audio/media/33
>
> > On 2 Sep., 22:35, code_android_festival_way
> > <[EMAIL PROTECTED]> wrote:
> > > Thank you very much for offering the sample code.
>
> > > On 2 Sep., 22:16, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > >  Please refer to theaudioRecording sample code at the link below:
> > > >  http://groups.google.com/group/android-developers/files
>
> > > > 2008/8/31 code_android_festival_way <[EMAIL PROTECTED]>
>
> > > > > Did you get theAudiorecording managed right now?
>
> > > > > I'm getting the same error again after adding all the fields. It
> > would
> > > > > be pretty nice to have a working example. Because from the docs I
> > > > > can't decide which fields are required and which are just optional.
>
> > > > > Regards!
>
> > > > > On 28 Aug., 07:16, Reto Meier <[EMAIL PROTECTED]> wrote:
> > > > > > Hi Justin,
> > > > > >   I've tried explicitly including the display name (and artist and
> > > > > > album) into the new ContentValue but still end up with exactly the
> > > > > > same error on the ContentResolver.insert call.
>
> > > > > > On Aug 27, 10:56 pm, "Justin (Google Employee)" <[EMAIL PROTECTED]>
> > > > > > wrote:
>
> > > > > > > > Error:
>
> > > > > > > > 08-24 19:27:18.675: ERROR/Database(178): Error inserting
> > > > > title=Content
> > > > > > > > Creation No.5 date_added=1219598838 _display_name= album_id=2
> > > > > > > > title_key=  -  E  C  O  1  C  O     -
> > > > > > > > K  1  )  O  9  E  C     C  E  &„   artist_id=3 using INSERT
> > INTO
> > > > > > > > audio_meta(title, date_added, _display_name, album_id,
> > title_key,
> > > > > > > > artist_id) VALUES(?, ?, ?, ?, ?, ?);
>
> > > > > > > From the error it jumps out at me that you're not setting
> > > > > > > MediaStore.Audio.Media.DISPLAY_NAME, which seems like its
> > required.
> > > > > > > Also, are you setting the ALBUM_ID and ARTIST_ID somehow or are
> > they
> > > > > > > encoded in the URI you're using?
>
> > > > > > > Cheers,
> > > > > > > Justin
> > > > > > > Android Team @ Google
>
> > > > > > > On Aug 24, 3:20 pm, code_android_festival_way
>
> > > > > > > <[EMAIL PROTECTED]> wrote:
> > > > > > > > I've got two questions.
>
> > > > > > > > 1)
> > > > > > > > Is there a working example for recordingaudiowith the
> > > > > MediaRecorder?
> > > > > > > > At the moment I'm using the following setup but it doesnt work:
>
> > > > > > > >http://paste.pocoo.org/show/83242/
>
> > > > > > > > Error:
>
> > > > > > > > 08-24 19:27:18.675: ERROR/Database(178): Error inserting
> > > > > title=Content
> > > > > > > > Creation No.5 date_added=1219598838 _display_name= album_id=2
> > > > > > > > title_key=  -  E  C  O  1  C  O     -
> > > > > > > > K  1  )  O  9  E  C     C  E  &„   artist_id=3 using INSERT
> > INTO
> > > > > > > > audio_meta(title, date_added, _display_name, album_id,
> > title_key,
> > > > > > > > artist_id) VALUES(?, ?, ?, ?, ?, ?);
>
> > > > > > > > I've tried the example provided in the docs (Media API) but
> > that
> > > > > > > > doesn't work at all. It would be nice if someone could provide
> > a
> > > > > > > > working example.
>
> > > > > > > > 2)
> > > > > > > > Is it normal that the raw data stream returned by
> > onPictureTaken(...)
> > > > > > > > is null?
>
> > > > > > > > 3)
>
> > > > > > > > I'm taking pictures as above mentioned. After that I'm saving
> > the
> > > > > > > > available jpeg stream into the image ContentProvider which
> > works
> > > > > fine.
> > > > > > > > Now I'm leaving my app and try to start the "Pictures"
> > application
> > > > > > > > from the home screen. And now I get the following error
> > message:
>
> > > > > > > >http://img.skitch.com/20080824-mrbc7yuhfh7an5ynndj9hm6twp.jpg
>
> > > > > > > > Here is the error from the logs:
>
> > > > > > > > 08-25 00:15:34.007: ERROR/AndroidRuntime(220):
> > > > > > > > java.lang.RuntimeException: Unable to resume activity
> > > > > > > > {com.android.camera/com.android.camera.GalleryPicker}:
> > > > > > > > java.lang.NullPointerException
>
> > > > > > > > I can savely say that I'm calling camera.stopPreview() and
> > > > > > > > camera.release() so there shouldn't be a problem with the
> > camera.
> > > > > What
> > > > > > > > else could be wrong?
>
> > > > > > > > Here is the part where I'm saving my jpeg byte[] into the
> > > > > > > > ContentProvider:
>
> > > > > > > >http://paste.pocoo.org/show/83246/
>
> > > > > > > > Regards!
>
>
--~--~---------~--~----~------------~-------~--~----~
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