The player features are as follows:
1. Pause, play
2. Drag bar implementation, fast forward, rewind
3. Sync Lyrics
4. Next song, last one.
5. Album Image display
6. Background playback, notice bar display
7. Call, pause, end of call, start playing.
The interface is as follows:
When playing, there will be an icon in the notification bar. Paused, Icon disappears
Background playback, will be displayed in the notification bar, click, you can enter the playback interface
Use details:
Download the music player module code to githob.
Add: Music player module code download
After downloading, unzip and import the project into eclipse.
The project as a library, introduced into the project using
1. Project Introduction
Create a project, click Item, right button, Properties,android,add
As the diagram interface:
Add time, select just you download the imported items, click OK
2. Configure Androidmanifest.xml
Access Network permissions:
<uses-permission android:name= "Android.permission.INTERNET"/>
Configure Activity and service:
<activity android:name= "Com.hck.music.ui.PlayMusicActivity" ></activity>
<service android:name= "Com.hck.music.server.PlayMusicServer" ></service>
An interface UI used by activity to play music
Service, a service to play music
3. OK, the project inside to use:
In use, you only need to use a intent, the corresponding data into, start playmusicactivity can
First put your data in the array, Musicean is a music entity class, in the downloaded source code can see its related properties, some of the information stored music. Like underneath.
private arraylist<musicbean> beans;
public void PlayMusic1 (view view) {//Click a button to play the video
Intent Intent = new Intent ();
Intent.setclass (this, playmusicactivity.class);
Intent.putextra ("Music", Beans.toarray ()); Beans is a collection of data that you put together.
Intent.putextra ("id", 0); The location of the collection beans to get the corresponding music object
Intent.putextra ("type", "net"); is online or local, online fill net, local, casually fill
StartActivity (Intent);
}
Music,id,type, no change.
All right, finish it.
Demo Download Address: Musicplayerdemo
Note that this demo needs and address: Music player module code to download the use of, music player module code, is the playback module, demo is the application of how to use the module.
The module code is completely transparent, we can more have their own needs, modify the code, modify the interface, there are detailed comments