Android菜鸟音乐开发,Android菜鸟做音乐播放器1 1.doc

Android菜鸟做音乐播放器1.1Android了,但是由于某些原因中途不得不中断Android的学习。现在有时间了而且想往Android这方面发展,所以想通过这个音乐播放器来巩固自己的基础也让我的水平更上一层楼。也希望与大家多多交流,各位牛人多多指教!

这是我这个音乐播放器的第一个版本,只能播放一首歌,有播放、暂停、重复、取消重复、停止等基本功能。播放一首歌曲只要用到MediaPlayer这个类就可以轻松的做到了,这个1.1版本主要用到这个类的start()(播放音乐),pause()(暂停音乐),stop()(停止音乐)等方法,具体介绍大家可以查看API,养成查看API的习惯对我们很有帮助。

先创建Android项目MusicPlayer

Application name :MusicPlayer

Package name :com.android.MusicPlayer

Create Activity :MusicPlayer

上代码:

string.xml:

view plaincopy to clipboardprint?

MusicPlayer!

MusicPlayer

播放

停止

重复

关于

退出

名称:音乐播放器\n

\n作者:ldj299\n

\n邮箱:ldj299@

确定

string.xml中,这样方便了我们以后对程序的修改

main.xml:

view plaincopy to clipboardprint?

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

>

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/hello"

/>

android:orientation="horizontal"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="@string/button_start"

/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="@string/button_stop"

/>

android:layout_width="wrap_conte

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值