// Path: app/src/main/java/io/recar/once2go/easynavi/data/Mp3Song.java
// public class Mp3Song {
// 
//     private long id;
//     private String title;
//     private String artist;
//     private String duration;
// 
//     public Mp3Song(long id, String title, String artist, String duration) {
//         this.id = id;
//         this.title = title;
//         this.artist = artist;
//         this.duration = duration;
//     }
// 
//     public long getId() {
//         return id;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public String getArtist() {
//         return artist;
//     }
// 
//     public String getDuration() {
//         return duration;
//     }
// }


import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.webkit.MimeTypeMap;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.recar.once2go.easynavi.data.Mp3Song;
package io.recar.once2go.easynavi.util;




/**
 * Created by once2go on 11.04.16.
 */
public class MusicSearchHelper {

    public static List<Mp3Song> getMusicList(Context context) {
        List<Mp3Song> mp3SongList = new ArrayList<>();
        ContentResolver musicResolver = context.getContentResolver();
        Uri musicUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;

        String selectionMimeType = MediaStore.Files.FileColumns.MIME_TYPE + "=?";
        String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension("mp3");
        String[] selectionArgsMp3 = new String[]{ mimeType };

        Cursor musicCursor = musicResolver.query(musicUri, null, selectionMimeType, selectionArgsMp3, null);
        if (musicCursor != null && musicCursor.moveToFirst()) {
// Path: app/src/main/java/io/recar/once2go/easynavi/data/Mp3Song.java
// public class Mp3Song {
// 
//     private long id;
//     private String title;
//     private String artist;
//     private String duration;
// 
//     public Mp3Song(long id, String title, String artist, String duration) {
//         this.id = id;
//         this.title = title;
//         this.artist = artist;
//         this.duration = duration;
//     }
// 
//     public long getId() {
//         return id;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public String getArtist() {
//         return artist;
//     }
// 
//     public String getDuration() {
//         return duration;
//     }
// }


// Path: app/src/main/java/io/recar/once2go/easynavi/util/MusicSearchHelper.java
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.webkit.MimeTypeMap;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.recar.once2go.easynavi.data.Mp3Song;

package io.recar.once2go.easynavi.util;




/**
 * Created by once2go on 11.04.16.
 */
public class MusicSearchHelper {

    public static List<Mp3Song> getMusicList(Context context) {
        List<Mp3Song> mp3SongList = new ArrayList<>();
        ContentResolver musicResolver = context.getContentResolver();
        Uri musicUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;

        String selectionMimeType = MediaStore.Files.FileColumns.MIME_TYPE + "=?";
        String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension("mp3");
        String[] selectionArgsMp3 = new String[]{ mimeType };

        Cursor musicCursor = musicResolver.query(musicUri, null, selectionMimeType, selectionArgsMp3, null);
        if (musicCursor != null && musicCursor.moveToFirst()) {
            int titleColumn = musicCursor.getColumnIndex