Android Introduction Camera.

Slides:



Advertisements
Similar presentations
Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
Advertisements

Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Mobile Programming Lecture 16 The Facebook API. Agenda The Setup Hello, Facebook User Facebook Permissions Access Token Logging Out Graph API.
Chapter 2: Simplify! The Android User Interface
1 Announcements Homework #2 due Feb 7 at 1:30pm Submit the entire Eclipse project in Blackboard Please fill out the when2meets when your Project Manager.
CE Applied Communications Technology Android lecture 2 - Structures Android File structure Resources Drawables Layout Values R Class Manifest Running.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Android - Broadcast Receivers
로봇을 조종하자 3/4 UNIT 17 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 스마트 폰의 센서를 사용할 수 있다. 2.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Linking Activities using Intents How to navigate between Android Activities 1Linking Activities using Intents.
1 Introducing Activity and Intent. 2 Memory LinearLayout, weight=2 LinearLayout, weight=1 TextView ListView.
Activity Android Club Agenda Hello Android application Application components Activity StartActivity.
Announcements Homework #2 will be posted after class due Thursday Feb 7, 1:30pm you may work with one other person No office hours tonight (sorry!) I will.
Mobile Device Development Camera and Sensors Dr.YingLiang Ma.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
Android App Basics Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5.
New Activity On Button Click via Intent. App->res->Layout->Blank Activity A new xml file is created and a new class is added to java folder. In manifest.xml.
Applications with Multiple Activities. Most applications will have more than one activity. The main activity is started when the application is started.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
Introducing Intents Intents Bind application components and navigate between them Transform device into collection of interconnected systems Creating a.
Lecture 2: Android Concepts
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Android Programming.
Chapter 2: Simplify! The Android User Interface
Lab7 – Appendix.
Android Programming - Features
Lecture 3: Animation & Graphics
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
Android Introduction Hello World
Lecture 2: Android Concepts
Android Application Development 1 6 May 2018
Android N Amanquah.
several communicating screens
Linking Activities using Intents
Adapting to Display Orientation
Android – Event Handling
Android Moving to a second Activity
Android Boot Camp for Developers Using Java, 3E
Android Introduction Hello World.
Android Notifications
XML Mihail L. Sichitiu.
Communication between Activities
CS499 – Mobile Application Development
Broadcast Receivers A Android Component where you can register for system or application events, receive and react to broadcast intent. Each broadcast.
Mobile Computing With Android ACST 4550 XML and the Android GUI
Mobile Device Development
Anatomy of an Android Application
CIS 470 Mobile App Development
CS323 Android Model-View-Controller Architecture
CIS 470 Mobile App Development
Many thanks to Jun Bum Lim for his help with this tutorial.
CMPE419 Mobile Application Development
Android Topics Android Activity Lifecycle and Experiment Toast
Activities and Intents
CIS 470 Mobile App Development
Android SDK & App Development
Android Notifications
Lecture 2: Android Concepts
BLP 4216 MOBİL UYGULAMA GELİŞTİRME-2
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
Chapter 5 Your Second Activity.
Android Play YouTuBe 建國科技大學 資管系 饒瑞佶 2017/10 V1.
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Android Introduction Camera

Goal Create an application that launches the built-in Camera and use the results for displaying the captured image.

Layout Make a LinearLayout with a TextView, a Button, and an ImageView Create a handler for the OnClick event of the Button

Launch Camera Creating an Intent, as follows, within your button click handler: Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Launch camera activity with asking result: startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);   define within your application as the request code returned by the Camera image capture Intent private static final int CAMERA_PIC_REQUEST = 1; 

Handling result from Camera By adding onActivityResult() in your Activity: protected void onActivityResult(int requestCode, int resultCode, Intent data) {       if (requestCode == CAMERA_PIC_REQUEST) { // display image            Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); ImageView imageTakePic = (ImageView) findViewById(R.id.imageViewPhone); imageTakePic.setImageBitmap(thumbnail);     }   } 

Enforcing Device Requirement <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ucab.test.camera" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="7" /> <uses-feature android:name="android.hardware.camera"></uses-feature> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".AndroidCameraActivity" android:label="@string/app_name"> <intent-filter> : Application wants a camera It is not enforced by Android