Android摄像头--通过Intent启动
来源:互联网 发布:网络销售工资高吗 编辑:程序博客网 时间:2024/05/16 18:24
通过Intent启动摄像头可以快速实现视频/图片的录制,但是这种方式调用的不是“摄像头”,而是Android设备的“摄像程序”,是手机厂商封装好的功能
@Overridepublic void onCreate(Bundle savedInstanceState) {Log.i("CAMERA", "开始执行Activity");super.onCreate(savedInstanceState);setContentView(R.layout.main);Log.i("CAMERA", "加载XML结束");// 创建新的IntentIntent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);// 创建保存视频的文件fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);// 设置视频文件名intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);// 设置视频的品质为高intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);// 启动视频捕获IntentstartActivityForResult(intent, CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);}其中getOutputMediaFileUri(int type)就是返回一个File,是媒体存储的路径
/** 为保存图片或视频创建File */ private static File getOutputMediaFile(int type){ // 生成一个File}还是那句,使用Intent调用的是手机厂商的摄像功能,貌似保存的文件并没有进入指定的文件夹中,很是不解......
- Android摄像头--通过Intent启动
- Android - 通过Intent启动Activity
- Android: 通过 intent 启动 Activity
- android 通过设置intent-filter 启动程序
- Android中通过intent启动另一个应用
- android里 通过Intent来启动其他非系统应用程序
- Android学习笔记(六)通过Intent启动其他Activity
- android 通过点击上下文菜单采用intent启动activity
- android 通过点击上下文菜单采用intent启动activity
- android 通过点击上下文菜单采用intent启动activity
- Android Intent隐式启动通过scheme打开应用
- Android摄像头启动顺序
- android 通过 包名启动Activity及intent.addCategory(Intent.CATEGORY_LAUNCHER);遗留问题
- android Intent启动flag
- android Intent启动flag
- Android--Intent启动活动
- Android隐式intent启动
- vs通过opencv如何启动外置摄像头
- JavaScript基础
- 分享:MSDN visual studio 2010简体中文旗舰版,专业版下载(内置正版密钥)
- RedHat Linux 6企业版开启VNC Server远程桌面
- H.264视频RTP负载格式
- 150. Experience is the father of wisdom and memory the mother. 经验是智慧之父,记忆是智慧之母
- Android摄像头--通过Intent启动
- traceroute命令略谈
- RTP payload type
- h264 rtp打包
- 实现RTP协议的h.264传输
- h.264码流打包分析
- stop:0X000007B
- rtp/rtcp协议详解
- javascript去除字符串空格的函数