Siêu thị PDFTải ngay đi em, trời tối mất

Thư viện tri thức trực tuyến

Kho tài liệu với 50,000+ tài liệu học thuật

© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Lập trình Android: Ứng dụng chụp ảnh pdf
MIỄN PHÍ
Số trang
3
Kích thước
120.5 KB
Định dạng
PDF
Lượt xem
1391

Lập trình Android: Ứng dụng chụp ảnh pdf

Nội dung xem thử

Mô tả chi tiết

Trung tâm Tin học – ĐH KHTN

Chụp hình

Trong 1 bài viết trước mình đã demo 1 chuong trình quay video, và trong bài viết này

mình sẽ demo tiếp 1 chương trình chụp ảnh sữ dụng Camera của thiết bị để chụp ảnh.

1/ Tạo Project :

Project name: CaptureImageWithIntent

Build Target: Android 2.3.3

Application name: CaptureImageWithIntent

Package name: com.dac.Image

Create Activity: MainActivity

2/ File layout main.java được thiết kế đơn giản như sau:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

>

<Button android:id="@+id/btn"

android:text="Take Picture"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:onClick="captureImage" />

</LinearLayout>

3/ File MainActivity.java :

package com.dac.Image

import java.io.File;

import android.app.Activity;

import android.content.ContentValues;

import android.content.Intent;

import android.content.pm.ActivityInfo;

import android.net.Uri;

Lập trình Android – http://laptrinhdidong.vn Page 1

Tải ngay đi em, còn do dự, trời tối mất!