模仿网易音乐播放器

要求:

1.实验报告要完整,即要有实验要求与目的、实验内容与步骤(必要流程图或活动图、代码)、运行结果与分析、实验体会与收获;

2.代码要有必要的注释;

3.标题为四号黑体,其他为宋体小四号,行间距为单倍行间距,纸张大小为A4;

4.考核项目

考核项目

格式与完成性

实验内容

实验结果与分析

实验体会与收获

总成绩

权重

20%

60%

10%

10%

100%

得分

  • 实验目的

1.了解服务的概述,能够说出什么是服务;

2.掌握服务的创建方式,能够独立创建一个服务;

3. 熟悉服务的生命周期,能够阐述服务生命周期中的方法;

4.掌握服务的两种启动方式,能够实现服务的启动与关闭功能;

5.掌握服务的通信,能够完成仿网易音乐播放器案例。

  • 实验工具

Android studio。

  • 实验内容

运行效果图如下:

  1. 完成上图的布局;

  2. 点击“播放”按钮、“暂停”按钮、“继续”按钮完成相应功能。

  • 实验过程(含代码)

   activity_main.xml: <?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical"

    android:gravity="center"

    android:background="@drawable/music_bg"

    tools:context=".MainActivity">



    <RelativeLayout

        android:layout_width="match_parent"

        android:layout_height="160dp">

        <RelativeLayout

            android:layout_width="300dp"

            android:layout_height="70dp"

            android:id="@+id/rl_title"

            android:layout_centerHorizontal="true"

            android:background="@drawable/title_bg"

            android:gravity="center_horizontal"

            android:paddingLeft="80dp">



            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:id="@+id/tv_music_title"

                android:layout_marginTop="8dp"

                android:text="体面"

                android:textSize="12sp"

                android:textStyle="bold"

                android:textColor="@color/black"/>

            <TextView

                android:layout_width="wrap_content"

                android:layout_height
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值