I wanted to get the Artist and Song name data from an MP3
(I added some links that could possibly help.)
Intent Intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("sdcard/song.mp3");
Intent.setDataAndType(data,"audio/mp3");
Try {
StartActivity(Intent);
} Catch (ActivityNotFoundException e) {
e.printStackTrace();
}
B4a?
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW,UriStr)
StartActivity(Intent1)
possible ref:
MediaMetadataRetriever | Android Developers
MediaStore | Android Developers
MyID3: a Java ID3 Tag Library
AsyncStreams Tutorial for MediaPlayerStream (mp3 stream)
(I added some links that could possibly help.)
Intent Intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("sdcard/song.mp3");
Intent.setDataAndType(data,"audio/mp3");
Try {
StartActivity(Intent);
} Catch (ActivityNotFoundException e) {
e.printStackTrace();
}
B4a?
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW,UriStr)
StartActivity(Intent1)
possible ref:
MediaMetadataRetriever | Android Developers
MediaStore | Android Developers
B4X:
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));
File k = new File(path, filename);
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, songTitle);
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mp3");
values.put(MediaStore.Audio.Media.ARTIST, "six3six");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values.put(MediaStore.Audio.Media.IS_ALARM, true);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);
return true;
}
AsyncStreams Tutorial for MediaPlayerStream (mp3 stream)
Last edited: