当前位置: 首页>>代码示例>>Java>>正文


Java AudioColumns.ALBUM属性代码示例

本文整理汇总了Java中android.provider.MediaStore.Audio.AudioColumns.ALBUM属性的典型用法代码示例。如果您正苦于以下问题:Java AudioColumns.ALBUM属性的具体用法?Java AudioColumns.ALBUM怎么用?Java AudioColumns.ALBUM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.provider.MediaStore.Audio.AudioColumns的用法示例。


在下文中一共展示了AudioColumns.ALBUM属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateLoader

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
	String[] projection = new String[] {
            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST,
    };
    StringBuilder selection = new StringBuilder();
    Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
    String sortOrder = Audio.Media.DEFAULT_SORT_ORDER;
    uri = Audio.Media.EXTERNAL_CONTENT_URI;
    long[] mNowPlaying = MusicUtils.getQueue();
    if (mNowPlaying.length == 0)
        return null;
    selection = new StringBuilder();
    selection.append(BaseColumns._ID + " IN (");
    if (mNowPlaying == null || mNowPlaying.length <= 0)
        return null;
    for (long queue_id : mNowPlaying) {
        selection.append(queue_id + ",");
    }
    selection.deleteCharAt(selection.length() - 1);
    selection.append(")");
	
    return new AddIdCursorLoader(getActivity(), uri, projection, selection.toString(), null,
            sortOrder);
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:25,代码来源:QuickQueueFragment.java

示例2: reloadQueueCursor

/**
 * Reload the queue after we remove a track
 */
private void reloadQueueCursor() {
    String[] projection = new String[] {
            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST,
    };
    StringBuilder selection = new StringBuilder();
    Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
    String sortOrder = Audio.Media.DEFAULT_SORT_ORDER;
    uri = Audio.Media.EXTERNAL_CONTENT_URI;
    long[] mNowPlaying = MusicUtils.getQueue();
    if (mNowPlaying.length == 0)
        return;
    selection = new StringBuilder();
    selection.append(BaseColumns._ID + " IN (");
    if (mNowPlaying == null || mNowPlaying.length <= 0)
        return;
    for (long queue_id : mNowPlaying) {
        selection.append(queue_id + ",");
    }
    selection.deleteCharAt(selection.length() - 1);
    selection.append(")");

    mCursor = MusicUtils.query(getActivity(), uri, projection, selection.toString(), null,
            sortOrder);
    mQuickQueueAdapter.changeCursor(mCursor);
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:28,代码来源:QuickQueueFragment.java

示例3: setupFragmentData

@Override
public void setupFragmentData() {
       mAdapter = new AlbumListAdapter(getActivity(), R.layout.music_listview_items, null,
               								new String[] {}, new int[] {}, 0);
   	mProjection = new String[] {
               BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
       };
       StringBuilder where = new StringBuilder();
       where.append(AudioColumns.IS_MUSIC + "=1")
       					.append(" AND " + MediaColumns.TITLE + " != ''");
       long albumId = getArguments().getLong(BaseColumns._ID);
       where.append(" AND " + AudioColumns.ALBUM_ID + "=" + albumId);
       mWhere = where.toString();        
       mSortOrder = Audio.Media.TRACK + ", " + Audio.Media.DEFAULT_SORT_ORDER;
       mUri = Audio.Media.EXTERNAL_CONTENT_URI;
       mFragmentGroupId = 89;
       mType = TYPE_ALBUM;
       mTitleColumn = MediaColumns.TITLE; 
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:19,代码来源:AlbumListFragment.java

示例4: setupFragmentData

public void setupFragmentData(){
    mAdapter = new RecentlyAddedAdapter(getActivity(), R.layout.music_listview_items,
            null, new String[] {}, new int[] {}, 0);
	mProjection = new String[] {
            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
    };
    StringBuilder where = new StringBuilder();
    int X = MusicUtils.getIntPref(getActivity(), NUMWEEKS, 5) * 3600 * 24 * 7;
    where.append(MediaColumns.TITLE + " != ''");
    where.append(" AND " + AudioColumns.IS_MUSIC + "=1");
    where.append(" AND " + MediaColumns.DATE_ADDED + ">"
            + (System.currentTimeMillis() / 1000 - X));
    mWhere = where.toString();
    mSortOrder = MediaColumns.DATE_ADDED + " DESC";
    mUri = Audio.Media.EXTERNAL_CONTENT_URI;
    mTitleColumn = MediaColumns.TITLE;       
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:17,代码来源:RecentlyAddedFragment.java

示例5: onLoadFinished

@Override
  public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
      if (data == null) {
          return;
      }
      long[] mNowPlaying = MusicUtils.getQueue();
  	String[] audioCols = new String[] { BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ARTIST, AudioColumns.ALBUM};
      MatrixCursor playlistCursor = new MatrixCursor(audioCols);
  	for(int i = 0; i < mNowPlaying.length; i++){
  		data.moveToPosition(-1);
  		while (data.moveToNext()) {
              long audioid = data.getLong(data.getColumnIndexOrThrow(BaseColumns._ID));
          	if( audioid == mNowPlaying[i]) {
                  String trackName = data.getString(data.getColumnIndexOrThrow(MediaColumns.TITLE));
                  String artistName = data.getString(data.getColumnIndexOrThrow(AudioColumns.ARTIST));
                  String albumName = data.getString(data.getColumnIndexOrThrow(AudioColumns.ALBUM));
          		playlistCursor.addRow(new Object[] {audioid, trackName, artistName, albumName });
          	}
          }
  	}
      data.close();
mCursor = playlistCursor;
      super.onLoadFinished(loader, playlistCursor);
  }
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:24,代码来源:NowPlayingFragment.java

示例6: setupFragmentData

public void setupFragmentData(){
    mAdapter = new GenreListAdapter(getActivity(), R.layout.music_listview_items, null,
            								new String[] {}, new int[] {}, 0);
	mProjection = new String[] {
            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM,
            AudioColumns.ARTIST
    };
    StringBuilder where = new StringBuilder();
    where.append(AudioColumns.IS_MUSIC + "=1").append(
            				" AND " + MediaColumns.TITLE + " != ''");
    mWhere = where.toString();        
    mSortOrder = Genres.Members.DEFAULT_SORT_ORDER;
    mUri = Genres.Members.getContentUri(EXTERNAL, getArguments().getLong(BaseColumns._ID));
    mFragmentGroupId = 3;
    mType = TYPE_GENRE;
    mTitleColumn = MediaColumns.TITLE; 
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:17,代码来源:GenreListFragment.java

示例7: setupFragmentData

@Override
public void setupFragmentData(){
    mAdapter = new ArtistListAdapter(getActivity(), R.layout.music_listview_items, null,
            								new String[] {}, new int[] {}, 0);
	mProjection = new String[] {
            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
    };
    StringBuilder where = new StringBuilder();
    where.append(AudioColumns.IS_MUSIC + "=1")
    					.append(" AND " + MediaColumns.TITLE + " != ''");
    long artist_id = getArguments().getLong(BaseColumns._ID);
    where.append(" AND " + AudioColumns.ARTIST_ID + "=" + artist_id);
    mWhere = where.toString();        
    mSortOrder = MediaColumns.TITLE;
    mUri = Audio.Media.EXTERNAL_CONTENT_URI;
    mFragmentGroupId = 88;
    mType = TYPE_ARTIST;
    mTitleColumn = MediaColumns.TITLE; 
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:19,代码来源:ArtistListFragment.java

示例8: setupFragmentData

@Override
public void setupFragmentData() {
       mAdapter = new AlbumListAdapter(getActivity(), R.layout.listview_items, null,
               								new String[] {}, new int[] {}, 0);
   	mProjection = new String[] {
               BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
       };
       StringBuilder where = new StringBuilder();
       where.append(AudioColumns.IS_MUSIC + "=1")
       					.append(" AND " + MediaColumns.TITLE + " != ''");
       long albumId = getArguments().getLong(BaseColumns._ID);
       where.append(" AND " + AudioColumns.ALBUM_ID + "=" + albumId);
       mWhere = where.toString();        
       mSortOrder = Audio.Media.TRACK + ", " + Audio.Media.DEFAULT_SORT_ORDER;
       mUri = Audio.Media.EXTERNAL_CONTENT_URI;
       mFragmentGroupId = 89;
       mType = TYPE_ALBUM;
       mTitleColumn = MediaColumns.TITLE; 
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:19,代码来源:AlbumListFragment.java

示例9: setupFragmentData

public void setupFragmentData(){
    mAdapter = new GenreListAdapter(getActivity(), R.layout.listview_items, null,
            								new String[] {}, new int[] {}, 0);
	mProjection = new String[] {
            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM,
            AudioColumns.ARTIST
    };
    StringBuilder where = new StringBuilder();
    where.append(AudioColumns.IS_MUSIC + "=1").append(
            				" AND " + MediaColumns.TITLE + " != ''");
    mWhere = where.toString();        
    mSortOrder = Genres.Members.DEFAULT_SORT_ORDER;
    mUri = Genres.Members.getContentUri(EXTERNAL, getArguments().getLong(BaseColumns._ID));
    mFragmentGroupId = 3;
    mType = TYPE_GENRE;
    mTitleColumn = MediaColumns.TITLE; 
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:17,代码来源:GenreListFragment.java

示例10: setupFragmentData

public void setupFragmentData(){
    mAdapter = new SonglistAdapter(getActivity(), R.layout.listview_items, null,
            										new String[] {}, new int[] {}, 0);
	mProjection = new String[] {
            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
    };
    StringBuilder where = new StringBuilder();
    where.append(AudioColumns.IS_MUSIC + "=1").append(" AND " + MediaColumns.TITLE + " != ''");
    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)
        {
            MusicUtils.suffle(getActivity());
        }

     });
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:26,代码来源:SongsFragment.java

示例11: onCreateLoader

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
	 String[] projection = new String[] {
             BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
     };
     StringBuilder where = new StringBuilder();
     String sortOrder = MediaColumns.DATE_ADDED + " DESC";
     Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
     int X = MusicUtils.getIntPref(getActivity(), NUMWEEKS, 5) * 3600 * 24 * 7;
     where = new StringBuilder();
     where.append(MediaColumns.TITLE + " != ''");
     where.append(" AND " + AudioColumns.IS_MUSIC + "=1");
     where.append(" AND " + MediaColumns.DATE_ADDED + ">"
             + (System.currentTimeMillis() / 1000 - X));
     return new AddIdCursorLoader(getActivity(), uri, projection, where.toString(), null, sortOrder);
    
    //return new RecentlyAddedLoader(getActivity());
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:18,代码来源:RecentlyAddedFragment.java

示例12: loadInBackground

@Override
  public Cursor loadInBackground() {

      Cursor mediaCursor = getContext().getContentResolver().query(mUri, mProjection, mSelection,
              mSelectionArgs, mSortOrder);
      //Get cursor filled with Audio Id's
      String [] projection =  new String[] {
              BaseColumns._ID, AlbumColumns.ALBUM
      };
      Uri uri = Audio.Albums.EXTERNAL_CONTENT_URI;
      String sortOrder = Audio.Albums.DEFAULT_SORT_ORDER;
      Cursor albumCursor = getContext().getContentResolver().query(uri, projection, null, null, sortOrder);

      //Matrix cursor to hold final data to be returned to calling context
      MatrixCursor cursor = new MatrixCursor( new String[]
      		{ BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ARTIST, AudioColumns.ALBUM, AudioColumns.ALBUM_ID});
      //Map data from Audio Id cursor to the ALbumName Colum
      ContentQueryMap mQueryMap = new ContentQueryMap(albumCursor, AlbumColumns.ALBUM, false, null);

Map<String, ContentValues> data = mQueryMap.getRows();
      if (mediaCursor != null) {
          while(mediaCursor.moveToNext()) {
		String id = mediaCursor.getString(mediaCursor.getColumnIndexOrThrow(BaseColumns._ID));
		String title = mediaCursor.getString(mediaCursor.getColumnIndexOrThrow(MediaColumns.TITLE));
		String artist = mediaCursor.getString(mediaCursor.getColumnIndexOrThrow(AudioColumns.ARTIST));
		String album = mediaCursor.getString(mediaCursor.getColumnIndexOrThrow(AudioColumns.ALBUM));

		ContentValues tData = data.get(album);
		String albumid = (String) tData.get(BaseColumns._ID);
		cursor.addRow(new String[] {id, title, artist, album, albumid});
          }
          mediaCursor.close();
      }

      if (cursor != null) {
          // Ensure the cursor window is filled
          registerContentObserver(cursor, mObserver);
      }
      return cursor;
  }
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:40,代码来源:AddIdCursorLoader.java

示例13: setupFragmentData

@Override
public void setupFragmentData() {
	mAdapter = new NowPlayingAdapter(getActivity(), R.layout.music_dragsort_listview_items, null,
	        							new String[] {}, new int[] {}, 0);
	mProjection = new String[] {
	            BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
	    };
	mSortOrder = Audio.Media.DEFAULT_SORT_ORDER;
	mUri = Audio.Media.EXTERNAL_CONTENT_URI;
	StringBuilder where = new StringBuilder();
	long[] mNowPlaying = MusicUtils.getQueue();
	if (mNowPlaying.length <= 0){
		where.append(AudioColumns.IS_MUSIC + "=1").append(" AND " + MediaColumns.TITLE + " != ''");
	}
	else{
		where.append(BaseColumns._ID + " IN (");
		for (long queue_id : mNowPlaying) {
		    where.append(queue_id + ",");
		}
		where.deleteCharAt(where.length() - 1);
		where.append(")");			
	}
	mWhere = where.toString();
       mMediaIdColumn = BaseColumns._ID;
       mType = TYPE_SONG;
       mFragmentGroupId = 91;
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:27,代码来源:NowPlayingFragment.java

示例14: setupFragmentData

@Override
public void setupFragmentData() {
	 mAdapter = new PlaylistListAdapter(getActivity(), R.layout.music_dragsort_listview_items, null,
                new String[] {}, new int[] {}, 0, mPlaylistId);

     StringBuilder where = new StringBuilder();
     where.append(AudioColumns.IS_MUSIC + "=1").append(" AND " + MediaColumns.TITLE + " != ''");
     mWhere = where.toString(); 
     mSortOrder = Playlists.Members.PLAY_ORDER;
        if(mPlaylistId == PLAYLIST_FAVORITES){
            long favorites_id = MusicUtils.getFavoritesId(getActivity());
       	 mProjection = new String[] {
                    Playlists.Members._ID, Playlists.Members.AUDIO_ID,
                    MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
            };
       	 mUri = Playlists.Members.getContentUri(EXTERNAL, favorites_id);
        }
        else{
       	 mProjection = new String[] {
                    Playlists.Members._ID, Playlists.Members.AUDIO_ID,
                    MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
            };
       	 mUri = Playlists.Members.getContentUri(EXTERNAL, mPlaylistId);        	 
        }
        mMediaIdColumn = Playlists.Members.AUDIO_ID;
        mType = TYPE_PLAYLIST;
        mFragmentGroupId = 90;
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:28,代码来源:PlaylistListFragment.java

示例15: setupFragmentData

@Override
public void setupFragmentData() {
	 mAdapter = new PlaylistListAdapter(getActivity(), R.layout.dragsort_listview_items, null,
                new String[] {}, new int[] {}, 0, mPlaylistId);

     StringBuilder where = new StringBuilder();
     where.append(AudioColumns.IS_MUSIC + "=1").append(" AND " + MediaColumns.TITLE + " != ''");
     mWhere = where.toString(); 
     mSortOrder = Playlists.Members.PLAY_ORDER;
        if(mPlaylistId == PLAYLIST_FAVORITES){
            long favorites_id = MusicUtils.getFavoritesId(getActivity());
       	 mProjection = new String[] {
                    Playlists.Members._ID, Playlists.Members.AUDIO_ID,
                    MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
            };
       	 mUri = Playlists.Members.getContentUri(EXTERNAL, favorites_id);
        }
        else{
       	 mProjection = new String[] {
                    Playlists.Members._ID, Playlists.Members.AUDIO_ID,
                    MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
            };
       	 mUri = Playlists.Members.getContentUri(EXTERNAL, mPlaylistId);        	 
        }
        mMediaIdColumn = Playlists.Members.AUDIO_ID;
        mType = TYPE_PLAYLIST;
        mFragmentGroupId = 90;
}
 
开发者ID:C-Aniruddh,项目名称:xPlodMusic,代码行数:28,代码来源:PlaylistListFragment.java


注:本文中的android.provider.MediaStore.Audio.AudioColumns.ALBUM属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。