Java Code Examples for android.provider.MediaStore.Audio.AudioColumns#DATA

The following examples show how to use android.provider.MediaStore.Audio.AudioColumns#DATA . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SongLoader.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
private static String generateBlacklistSelection(String selection, int pathCount) {
    String newSelection = selection != null && !selection.trim().equals("") ? selection + " AND " : "";
    newSelection += AudioColumns.DATA + " NOT LIKE ?";
    for (int i = 0; i < pathCount - 1; i++) {
        newSelection += " AND " + AudioColumns.DATA + " NOT LIKE ?";
    }
    return newSelection;
}
 
Example 2
Source File: SongLoader.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private static String generateBlacklistSelection(String selection, int pathCount) {
    String newSelection = selection != null && !selection.trim().equals("") ? selection + " AND " : "";
    newSelection += AudioColumns.DATA + " NOT LIKE ?";
    for (int i = 0; i < pathCount - 1; i++) {
        newSelection += " AND " + AudioColumns.DATA + " NOT LIKE ?";
    }
    return newSelection;
}
 
Example 3
Source File: SongLoader.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private static String generateBlacklistSelection(String selection, int pathCount) {
    String newSelection = selection != null && !selection.trim().equals("") ? selection + " AND " : "";
    newSelection += AudioColumns.DATA + " NOT LIKE ?";
    for (int i = 0; i < pathCount - 1; i++) {
        newSelection += " AND " + AudioColumns.DATA + " NOT LIKE ?";
    }
    return newSelection;
}
 
Example 4
Source File: SongLoader.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
private static String generateBlacklistSelection(String selection, int pathCount) {
    String newSelection = selection != null && !selection.trim().equals("") ? selection + " AND " : "";
    newSelection += AudioColumns.DATA + " NOT LIKE ?";
    for (int i = 0; i < pathCount - 1; i++) {
        newSelection += " AND " + AudioColumns.DATA + " NOT LIKE ?";
    }
    return newSelection;
}
 
Example 5
Source File: MusicSongListFragment.java    From mobile-manager-tool with MIT License 4 votes vote down vote up
public void setupFragmentData(){
        mAdapter = new ApolloSongListAdapter(getActivity(), R.layout.music_listview_items, null,
                										new String[] {}, new int[] {}, 0);
    	mProjection = new String[] {
                BaseColumns._ID,
                MediaColumns.TITLE,
                AudioColumns.ALBUM,
                AudioColumns.ARTIST,
                AudioColumns.DATA
        };

        StringBuilder where = new StringBuilder();
        where.append(AudioColumns.IS_MUSIC).append(" =1 AND ").append( MediaColumns.TITLE).append(" != ''");
        mWhere = where.toString();
        mSortOrder = Audio.Media.DEFAULT_SORT_ORDER;
        mUri = Audio.Media.EXTERNAL_CONTENT_URI;
        mFragmentGroupId = 3;
        mType = TYPE_SONG;
        mTitleColumn = MediaColumns.TITLE;
        // 随机播放
//        View shuffle_temp = View.inflate(getActivity(), R.layout.shuffle_all, null);
//        mListView.addHeaderView(shuffle_temp);
//    	RelativeLayout  shuffle = (RelativeLayout)shuffle_temp.findViewById(R.id.shuffle_wrapper);
//    	shuffle.setVisibility(View.VISIBLE);
//    	shuffle.setOnClickListener(new RelativeLayout.OnClickListener() {
//            public void onClick(View v)
//            {
//                Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
//                String[] projection = new String[] {
//                    BaseColumns._ID
//                };
//                String selection = AudioColumns.IS_MUSIC + "=1";
//                String sortOrder = "RANDOM()";
//                Cursor cursor = MusicUtils.query(getActivity(), uri, projection, selection, null, sortOrder);
//                if (cursor != null) {
//                    MusicUtils.shuffleAll(getActivity(), cursor);
//                    cursor.close();
//                    cursor = null;
//                }
//            }
//         });
    }