from sd card to database in android
<p>hi all
i want to store song name into database from sd card. i use the following code but it does not store song name. it store wrong content.
my code is :</p>

<pre><code>        final String[] proj = { MediaStore.Audio.Media._ID,MediaStore.Audio.Media.DATA,MediaStore.Audio.Media.DISPLAY_NAME,MediaStore.Audio.Media.SIZE };
        Log.e("media",""+proj.length);

        SQLiteDatabase db;
        db = openOrCreateDatabase("TestData.db", SQLiteDatabase.CREATE_IF_NECESSARY, null);
        db.setVersion(1);
        db.setLocale(Locale.getDefault());
        db.setLockingEnabled(true);
        final String CREATE_TABLE_COUNTRIES ="CREATE TABLE IF NOT EXISTS songs (bpm INTEGER,songname TEXT);";
        db.execSQL(CREATE_TABLE_COUNTRIES);
        Log.e("media","table created");
        ContentValues values = new ContentValues();
        for(int i=0;i&lt;proj.length;i++){
            values.put("bpm", 0); 
            values.put("songname", proj[i]);    
            db.insert("songs", null, values);
        }
        Log.e("media","insered");
        Cursor cx = db.rawQuery("select * from songs"  , null);
        if (cx != null ) {
        if  (cx.moveToFirst()) {
          do {    int bpm=cx.getInt(0);
                  String songname =cx.getString(1);
                  Log.e("songs","bpm "+bpm+" songname "+songname);
          }while (cx.moveToNext());
        }
        }


        db.close();         


musiccursor = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,proj, null, null, null);
        Log.e("media1",""+musiccursor);
</code></pre>

<p>my log cat output is :</p>

<pre><code>05-02 12:28:02.716: ERROR/media(957): 4
05-02 12:28:03.156: ERROR/media(957): table created
05-02 12:28:03.986: ERROR/media(957): insered
05-02 12:28:03.986: ERROR/songs(957): bpm 0 songname _id
05-02 12:28:03.986: ERROR/songs(957): bpm 0 songname _data
05-02 12:28:03.986: ERROR/songs(957): bpm 0 songname _display_name
05-02 12:28:03.986: ERROR/songs(957): bpm 0 songname _size
05-02 12:28:04.026: ERROR/media1(957): android.content.ContentResolver$CursorWrapperInner@4357b868
</code></pre>

<p>please assist me.</p>
