你好,游客 登录 注册 搜索
背景:
阅读新闻

Android音乐和视频播放【附源码】

[日期:2012-05-27] 来源:Linux社区  作者:hc260164797 [字体:大 中 小]
程序的布局文件是:
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"  
  3.     android:layout_width="fill_parent"  
  4.     android:layout_height="fill_parent"  
  5.     android:orientation="vertical"   
  6.     android:id="@+id/background">  
  7. <SeekBar   
  8.     android:id="@+id/seekbar_music"  
  9.     android:layout_width="fill_parent"  
  10.     android:layout_height="wrap_content"/>      
  11. <RelativeLayout android:id="@+id/background_music_btn"  
  12.     android:layout_width="fill_parent"  
  13.     android:layout_height="wrap_content">  
  14. <Button   
  15.     android:id="@+id/start_music_btn"  
  16.     android:layout_width="wrap_content"  
  17.     android:layout_height="wrap_content"  
  18.     android:text="播放音乐"  
  19.     android:textSize="20dip"  
  20.     android:layout_marginLeft="30dip"/>  
  21.   
  22. <Button  
  23.     android:id="@+id/stop_music_btn"  
  24.     android:layout_width="wrap_content"  
  25.     android:layout_height="wrap_content"  
  26.     android:layout_alignParentRight="true"  
  27.     android:layout_alignParentTop="true"  
  28.     android:text="停止播放"  
  29.     android:textSize="20dip"   
  30.     android:layout_marginRight="30dip"/>  
  31. </RelativeLayout>  
  32. <SeekBar   
  33.     android:id="@+id/seekbar_video"  
  34.     android:layout_width="fill_parent"  
  35.     android:layout_height="wrap_content"/>  
  36. <SurfaceView   
  37.     android:id="@+id/surfaceview_video"  
  38.     android:layout_height="320dip"  
  39.     android:layout_width="fill_parent"/>  
  40. <RelativeLayout android:id="@+id/background_video_btn"  
  41.     android:layout_width="fill_parent"  
  42.     android:layout_height="wrap_content"  
  43.     android:layout_marginBottom="10dip">  
  44. <Button   
  45.     android:id="@+id/start_video_btn"  
  46.     android:layout_width="wrap_content"  
  47.     android:layout_height="wrap_content"  
  48.     android:text="播放视频"  
  49.     android:textSize="20dip"  
  50.     android:layout_marginLeft="30dip"/>  
  51.   
  52. <Button  
  53.     android:id="@+id/stop_video_btn"  
  54.     android:layout_width="wrap_content"  
  55.     android:layout_height="wrap_content"  
  56.     android:layout_alignParentRight="true"  
  57.     android:layout_alignParentTop="true"  
  58.     android:text="停止播放"  
  59.     android:textSize="20dip"   
  60.     android:layout_marginRight="30dip"/>  
  61. </RelativeLayout>  
  62. </LinearLayout>  

基本上代码注释的已经比较详细,源码已经打包上传,有需要的可以下载

下载在Linux公社的1号FTP服务器里,下载地址:

FTP地址:ftp://www.linuxidc.com

用户名:www.linuxidc.com

密码:www.muu.cc

在 2012年LinuxIDC.com\5月\Android音乐和视频播放【附源码】

下载方法见 http://www.linuxidc.net/thread-1187-1-1.html

 

更多Android相关信息见Android 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=11

linux
相关资讯       Android编程开发教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款