【Android应用实例00】 用摄像头录制视频并本地保存

本文详细介绍了如何在Android应用中实现摄像头视频录制功能,并将录制的视频保存到本地。通过解析XML布局文件,编写Java代码,并在AndroidManifest中添加必要的权限,读者可以掌握这一实用技巧。
摘要由CSDN通过智能技术生成

main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}" >
<SurfaceView
        android:id="@+id/surfaceview"
        android:layout_width="400dp"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_margin="3dp" /> 


 <LinearLayout   
        android:id="@+id/li1"  
        android:orientation="horizontal"  
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/surfaceview"
        >  
        <Button android:id="@+id/start"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="start"/>  
         <Button android:id="@+id/stop"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="stop"/>  
                <Button 
            android:id="@+id/card"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="setID"/>   



    </LinearLayout>  

  <LinearLayout   
        android:id="@+id/li2"  
        android:orientation="vertical" 
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/surfaceview"
        android:layout_below="@+id/li1"
        >  
        <RadioGroup  
        android:layout_width="match_parent"  
        android:layout_height="match_parent"  
        android:id="@+id/radiogroup1"  

        >  
          <RadioButton 
            android:id="@+id/rb1"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="warpCopper"/>  
         <RadioButton 
             android:id="@+id/rb2"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="warpA4"/>  
            <RadioButton 
            android:id="@+id/rb3"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="cutEyeCopp"/>  
         <RadioButton 
             android:id="@+id/rb4"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="movEyeA4"/>  
            <RadioButton 
            android:id="@+id/rb5"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="netVideo   "/>  
         <RadioButton 
             android:id="@+id/rb6"  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:layout_weight="1"  
            android:text="netPicture"/>  
            <RadioButton
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值