Hello,

I'm trying to insert a new mp3 file to the SDCARD using Content Providers.
I'm doing everything as in the tutorial is written in Google page:

ContentValues values = new ContentValues(4);
values.put(MediaStore.Audio.Media.DISPLAY_NAME, "MySong");
values.put(MediaStore.Audio.Media.MIME_TYPE, "audio/mpeg");
values.put(MediaStore.Audio.Media.COMPOSER, "me");
values.put(MediaStore.Audio.Media.TITLE, p_Description);

Uri l_uri =
getContentResolver().insert(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
values);




But the insert method returns with null, and I got the following SQLite
error-log:
10-25 18:59:48.786: ERROR/Database(150): Error inserting
mime_type=audio/mpeg title=Normal_8 date_added=1224953988 _display_name=
composer=rcptones album_id=-1 title_key=..C..E..K..A..)..?.........&......
artist_id=-1
10-25 18:59:48.786: ERROR/Database(150):
android.database.sqlite.SQLiteConstraintException: error code 19
10-25 18:59:48.786: ERROR/Database(150): at
android.database.sqlite.SQLiteStatement.native_execute(Native Method)
10-25 18:59:48.786: ERROR/Database(150): at
android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:48)
10-25 18:59:48.786: ERROR/Database(150): at
android.database.sqlite.SQLiteDatabase.insertOrReplace(SQLiteDatabase.java:1170)
10-25 18:59:48.786: ERROR/Database(150): at
android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1047)
10-25 18:59:48.786: ERROR/Database(150): at
com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:995)
10-25 18:59:48.786: ERROR/Database(150): at
com.android.providers.media.MediaProvider.insert(MediaProvider.java:885)
10-25 18:59:48.786: ERROR/Database(150): at
android.content.ContentProvider$Transport.insert(ContentProvider.java:139)
10-25 18:59:48.786: ERROR/Database(150): at
android.content.ContentProviderNative.onTransact(ContentProviderNative.java:124)
10-25 18:59:48.786: ERROR/Database(150): at
android.os.Binder.execTransact(Binder.java:276)
10-25 18:59:48.786: ERROR/Database(150): at
dalvik.system.NativeStart.run(Native Method)



The first line of the log shows that the _display_name remained empty even
if I set it to "MySong".
If somebody knows, what would be the problem, please write it!

Best regards,
Ernest

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