Error to add WAV file into Android database Options There a

All your problems with Audio, Video and Images.

Error to add WAV file into Android database Options There a

Postby Dayn » Mon Aug 24, 2009 9:51 am

I'm so lost to choice the true name and description of wav file which
I want to add into Android database:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. ContentResolver cr = getContentResolver();
  2.  
  3. try
  4. {
  5.  //  byte[] is the decoded message
  6.         byte[] decoded = Base64.decode( oClient.getMsg(0).getMsgBase64() );
  7.  
  8.         ContentValues values = new ContentValues();
  9.         values.put(Media.DISPLAY_NAME, "Voicemail");
  10.         //  values.put(Media.MIME_TYPE, "Audio/wav");
  11.         values.put(Media.CONTENT_TYPE, "Audio/wav");
  12.         values.put(Media._ID, 1);
  13.         values.put(Media.DATA, decoded);
  14.  
  15.         Uri uri = cr.insert(Media.INTERNAL_CONTENT_URI, values);
  16.  }
  17.  catch(Exception e)
  18.  {
  19.         Log.v(TAG, "ERROR Exception: " + e);
  20.  }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


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


Thanks in advance

Dayn
User avatar
Dayn
Developer
Developer
 
Posts: 31
Joined: Thu Jul 09, 2009 10:45 am
Location: Paris and Dijon

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 23 guests