智能终端课程设计之安卓音乐播放器

智能终端课程设计之安卓音乐播放器

这里是一个最基本最简单的本地音乐播放器,应付课设基本就OK了。

不要脸😀的把项目扔上来:https://github.com/Chuyuxuan0v0/AndroidMusic

课设题目要求

========================================================
题目九 音乐播放器
一、目的与要求

  1. 学会如何使用 MediaPlayer 等媒体播放组件。 2. 学会如何进行数据保存。
    音乐播放器主要的功能:
  2. 播放列表:在设置菜单,读取 sdcard 指定目录下的所有 mp3 文件,建立播放列表。
  3. 播放控制:能够对播放进行控制,能够开始/继续播放、暂停播放、停止播放、上一 首、下一首。
  4. 保存播放记录:能够存储已播放过的历史。
  5. 扩展功能:(1)增加歌曲库的概念;(2)给歌曲设置类别标签,根据已播放的历 史,在界面上的推荐区域展示推荐歌曲;(3)根据歌名,搜索下载网上的歌曲。

==========================================================

界面展示

图片名称 图片名称

实现方法

1、layout_main文件编写

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/welcomimg1">
   <RelativeLayout
       android:layout_width="match_parent"
       android:layout_height="70dp"
       android:layout_alignParentBottom="true"
       android:id="@+id/local_music_bottomlayout">
<!--       android:background="#33EEEEEE"-->

       <ImageView
           android:layout_width="match_parent"
           android:layout_height="0.5dp"/>
<!--           android:background="#9933FA"-->
       <ImageView
           android:layout_width="60dp"
           android:layout_height="60dp"
           android:src="@drawable/music1"
           android:layout_centerVertical="true"
           android:background="@mipmap/a1"
           android:layout_marginLeft="10dp"
           android:id="@+id/local_music_bottom_iv_icon"/>
       <TextView
           android:id="@+id/local_music_bottom_tv_song"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:text=""
           android:layout_toRightOf="@id/local_music_bottom_iv_icon"
           android:layout_marginTop="10dp"
           android:layout_marginLeft="10dp"
           android:textSize="10sp"
           android:textStyle="bold"/>
       <TextView
           android:id="@+id/local_music_bottom_tv_singer"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:text=""
           android:textSize="8sp"
           android:layout_below="@id/local_music_bottom_tv_song"
           android:layout_alignLeft="@id/local_music_bottom_tv_song"
           android:layout_marginTop="10dp"/>

       <ImageView
           android:id="@+id/local_music_bottom_iv_next"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_centerVertical="true"
           android:src="@mipmap/play_next"
           android:layout_alignParentRight="true"
           android:layout_marginRight="10dp"/>

       <ImageView
           android:id="@+id/local_music_bottom_iv_play"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_centerVertical="true"
           android:src="@mipmap/play"
           android:layout_toLeftOf="@id/local_music_bottom_iv_next"
           android:layout_marginRight="20dp"/>

       <ImageView
           android:id="@+id/local_music_bottom_iv_last"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_centerVertical="true"
           android:src="@mipmap/play_front"
           android:layout_toLeftOf="@id/local_music_bottom_iv_play"
           android:layout_marginRight="20dp"/>
   </RelativeLayout>
    <android.support.v7.widget.RecyclerView
        android:id="@+id/local_music_rv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/local_music_bottomlayout">

    </android.support.v7.widget.RecyclerView>
</RelativeLayout>

2、layout_welcome文件编写

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/welcommig1">

    <TextView

        android:id="@+id/tc1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_marginTop="197dp"
        android:layout_marginEnd="139dp"
        android:fontFamily="sans-serif-condensed-medium"
        android:text="BUG  Player"
        android:textColor="#FDFCFC"
        android:textSize="28dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tc1"
        android:layout_alignParentLeft="true&#
  • 21
    点赞
  • 121
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值