Android Open Source - LocalMusicPlayer Song






From Project

Back to project page LocalMusicPlayer.

License

The source code is released under:

MIT License

If you think the Android project LocalMusicPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.yprikhodko.localmusicplayer;
/* w w w .ja  v a  2 s.  c  om*/
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.provider.MediaStore;

import java.io.IOException;

/**
 * Created by yasha on 12/12/14.
 */
public class Song {
    private long id;
    private String title;
    private String artist;
    private Uri artwork;

    public Song(long songID, String songTitle, String songArtist, Uri songArtwork) {
        id = songID;
        title = songTitle;
        artist = songArtist;
        artwork = songArtwork;
    }

    public long getID(){return id;}
    public String getTitle(){return title;}
    public String getArtist(){return artist;}
    public Uri getArtwork(){return artwork;}
    public Bitmap getArtworkBitmap(Context ctx) {
        Bitmap bitmap = null;
        try {
            bitmap = MediaStore.Images.Media.getBitmap(ctx.getContentResolver(), artwork);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return bitmap;
    }
}




Java Source Code List

com.yprikhodko.localmusicplayer.ApplicationTest.java
com.yprikhodko.localmusicplayer.MusicService.java
com.yprikhodko.localmusicplayer.RecyclerItemClickListener.java
com.yprikhodko.localmusicplayer.SongAdapter.java
com.yprikhodko.localmusicplayer.SongViewHolder.java
com.yprikhodko.localmusicplayer.Song.java
com.yprikhodko.localmusicplayer.SongsFragment.java
com.yprikhodko.localmusicplayer.StartActivity.java