Advertisement

安卓开发(简单实现摄像头功能)

阅读量:

坦白来说,为了实现摄像头的调用,查阅了大量相关博客,耗费了整整一个晚上才完成,主要借鉴了一篇文章学会Android Camera2 Api,实现自定义相机入门。 - 简书的内容。

仅采用了其中camera2部分的代码,并对其进行了一定程度的精简,去除了不必要的内容。

接下来直接展示代码部分。

布局文件:

复制代码
 <?xml version="1.0" encoding="utf-8"?>

    
 <android.support.constraint.ConstraintLayout 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="matc

全部评论 (0)

还没有任何评论哟~