應(yīng)用場景:
在Android開發(fā)過程中,有時需要調(diào)用手機自身設(shè)備的功能,上篇文章主要側(cè)重攝像頭拍照功能的調(diào)用。本篇文章將綜合實現(xiàn)拍照與視頻的操作。
知識點介紹:
該部分請閱讀 【Android 調(diào)用攝像頭功能】
使用方式:
第一步:
新建一個Android項目CameraPhotoVedio,包含兩個Activity: MainActivity、CameraActivity。
第二步:
activity_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" android:background="@drawable/shape_main" tools:context=".MainActivity" > <LinearLayout android:layout_height="wrap_content" android:layout_marginTop="50dp" android:layout_width="match_parent" android:orientation="vertical"> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:src="@drawable/main"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_marginTop="100dp" android:layout_width="match_parent" android:layout_alignParentBottom="true" android:orientation="vertical"> <Button android:id="@+id/main_button" android:layout_height="50dp" android:layout_marginBottom="50dp" android:background="@drawable/shape_main" android:layout_width="match_parent" android:textColor="#FFFFFF" android:text="使用攝像頭"/> </LinearLayout> </RelativeLayout>
分享文章:Android實現(xiàn)調(diào)用攝像頭拍照與視頻功能-創(chuàng)新互聯(lián)
標(biāo)題來源:http://jinyejixie.com/article32/dhdspc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊、微信公眾號、營銷型網(wǎng)站建設(shè)、Google、網(wǎng)站內(nèi)鏈、軟件開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容