Chinaunix首页 | 论坛 | 博客
  • 博客访问: 208400
  • 博文数量: 102
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1015
  • 用 户 组: 普通用户
  • 注册时间: 2013-06-05 16:45
文章存档

2014年(73)

2013年(29)

我的朋友

分类: Android平台

2014-04-06 17:12:48

Mp3Player(12) AndroidMainfext.xml、Mp3Info、AppConstant

AndroidMainfext.xml:

点击(此处)折叠或打开

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android=""
  3.     package="com.lwb.mp3player"
  4.     android:versionCode="1"
  5.     android:versionName="1.0" >

  6.     <uses-sdk
  7.         android:minSdkVersion="8"
  8.         android:targetSdkVersion="17" />

  9.     <application
  10.         android:allowBackup="true"
  11.         android:icon="@drawable/ic_launcher2"
  12.         android:label="@string/app_name"
  13.         android:theme="@style/AppTheme" >
  14.         <activity
  15.             android:name="com.lwb.mp3player.MainActivity"
  16.             android:label="@string/app_name" >
  17.             <intent-filter>
  18.                 <action android:name="android.intent.action.MAIN" />

  19.                 <category android:name="android.intent.category.LAUNCHER" />
  20.             </intent-filter>
  21.         </activity>
  22.        <activity android:name ="com.lwb.mp3player.Mp3ListActivity"
  23.             android:label="@string/app_name"></activity>
  24.         <activity android:name ="com.lwb.mp3player.LocalMp3ListActivity"
  25.             android:label="@string/app_name"></activity>
  26.         <activity android:name ="com.lwb.mp3player.PlayerActivity"
  27.             android:label="@string/app_name"></activity>
  28.         <service android:name="com.lwb.mp3player.service.DownloadService"></service>
  29.         <service android:name="com.lwb.mp3player.service.PlayerService"></service>
  30.     </application>
  31.     
  32.         <!-- 在下面一定记得添加 许可 uses-permission-->
  33.     <uses-permission android:name="android.permission.INTERNET"/>
  34.     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

  35. </manifest>

点击(此处)折叠或打开

  1. //Mp3Info.java
  2. package com.lwb.model;

  3. import java.io.Serializable;

  4. /*Mp3Info描述了一个mp3的所有属性并实现了Serializable接口*/
  5. public class Mp3Info implements Serializable{
  6.     
  7.     
  8.     private static final long serialVersionUID = 1L;
  9.     
  10.     //把属性 变成字符串,用于测试
  11.     @Override
  12.     public String toString() {
  13.         return "Mp3Info [id=" + id + ", mp3Name=" + mp3Name + ", mp3Size="
  14.                 + mp3Size + ", lrcName=" + lrcName + ", lrcSize=" + lrcSize
  15.                 + "]";
  16.     }
  17.     
  18.     public String getId() {
  19.         return id;
  20.     }
  21.     public void setId(String id) {
  22.         this.id = id;
  23.     }
  24.     
  25.     public String getMp3Name() {
  26.         return mp3Name;
  27.     }
  28.     public void setMp3Name(String mp3Name) {
  29.         this.mp3Name = mp3Name;
  30.     }
  31.     
  32.     public String getMp3Size() {
  33.         return mp3Size;
  34.     }
  35.     public void setMp3Size(String mp3Size) {
  36.         this.mp3Size = mp3Size;
  37.     }
  38.     
  39.     public String getLrcName() {
  40.         return lrcName;
  41.     }
  42.     public void setLrcName(String lrcName) {
  43.         this.lrcName = lrcName;
  44.     }
  45.     
  46.     public String getLrcSize() {
  47.         return lrcSize;
  48.     }
  49.     public void setLrcSize(String lrcSize) {
  50.         this.lrcSize = lrcSize;
  51.     }
  52.     
  53.     //构造函数
  54.     public Mp3Info() {
  55.         super();
  56.     }
  57.     
  58.     //构造函数
  59.     public Mp3Info(String id, String mp3Name, String mp3Size, String lrcName,
  60.             String lrcSize) {
  61.         super();
  62.         this.id = id;
  63.         this.mp3Name = mp3Name;
  64.         this.mp3Size = mp3Size;
  65.         this.lrcName = lrcName;
  66.         this.lrcSize = lrcSize;
  67.     }

  68.     //一首歌的属性
  69.     private String id;
  70.     private String mp3Name;
  71.     private String mp3Size;
  72.     private String lrcName;
  73.     private String lrcSize;    
  74. }


点击(此处)折叠或打开

  1. //AppConstant.java
  2. package com.lwb.mp3player;
  3. public interface AppConstant{
  4.     public class PlayerMsg {
  5.         public static final int PLAY_MSG=1;
  6.         public static final int PAUSE_MSG=2;
  7.         public static final int STOP_MSG=3;        
  8.     }
  9.     public static final String LRC_MESSAGE_ACTION= "com.lwb.lrcmessage.action";
  10. }


阅读(1028) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~