I'm so lost to choice the true name and description of wav file which
I want to add into Android database:
ContentResolver cr = getContentResolver();
try
{
// byte[] is the decoded message
byte[] decoded = Base64.decode( oClient.getMsg(0).getMsgBase64() );
ContentValues values = new ContentValues();
values.put(Media.DISPLAY_NAME, "Voicemail");
// values.put(Media.MIME_TYPE, "Audio/wav");
values.put(Media.CONTENT_TYPE, "Audio/wav");
values.put(Media._ID, 1);
values.put(Media.DATA, decoded);
Uri uri = cr.insert(Media.INTERNAL_CONTENT_URI, values);
}
catch(Exception e)
{
Log.v(TAG, "ERROR Exception: " + e);
}
My error is:
08-24 08:03:03.882: ERROR/Database(652): Error inserting
date_added=1251100983 _display_name= _id=1 vnd.android.cursor.dir/
audio=Audio/wav album_id=-1 title_key= artist_id=-1
08-24 08:03:03.882: ERROR/Database(652):
android.database.sqlite.SQLiteException: near ".": syntax error: ,
while compiling: INSERT INTO audio_meta(date_added, _display_name,
_id, vnd.android.cursor.dir/audio, album_id, title_key, artist_id)
VALUES(?, ?, ?, ?, ?, ?, ?);
08-24 08:03:03.882: ERROR/Database(652): at
android.database.sqlite.SQLiteProgram.native_compile(Native Method)
08-24 08:03:03.882: ERROR/Database(652): at
android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)
08-24 08:03:03.882: ERROR/Database(652): at
android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:59)
08-24 08:03:03.882: ERROR/Database(652): at
android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:
41)
08-24 08:03:03.882: ERROR/Database(652): at
android.database.sqlite.SQLiteDatabase.compileStatement
(SQLiteDatabase.java:925)
08-24 08:03:03.882: ERROR/Database(652): at
android.database.sqlite.SQLiteDatabase.insertWithOnConflict
(SQLiteDatabase.java:1300)
08-24 08:03:03.882: ERROR/Database(652): at
android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:
1173)
08-24 08:03:03.882: ERROR/Database(652): at
com.android.providers.media.MediaProvider.insertInternal
(MediaProvider.java:1228)
08-24 08:03:03.882: ERROR/Database(652): at
com.android.providers.media.MediaProvider.insert(MediaProvider.java:
1118)
08-24 08:03:03.882: ERROR/Database(652): at
android.content.ContentProvider$Transport.insert(ContentProvider.java:
140)
08-24 08:03:03.882: ERROR/Database(652): at
android.content.ContentProviderNative.onTransact
(ContentProviderNative.java:125)
08-24 08:03:03.882: ERROR/Database(652): at
android.os.Binder.execTransact(Binder.java:287)
08-24 08:03:03.882: ERROR/Database(652): at
dalvik.system.NativeStart.run(Native Method)
08-24 08:03:04.124: WARN/IInputConnectionWrapper(610): showStatusIcon
on inactive InputConnection
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---