- Rohit Vobbilisetty. What is the Camera API Capture Photos Capture Videos Camera API - Android2.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Advertisements

Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk.
What we will cover today… Where is the camera on my phone? Taking a photo Zoom in and out Deleting a photo Where do my photos go to? Viewing my photos.
Using Your D.U.I.D Detect Application. Adding D.U.I.D Detect to your phone iPhone 1.Open Safari 2.Enter 3.Click.
ANDROID DEVELOPMENT KELLY MCBEAN. DEVELOPMENT ENVIRONMENT OVERVIEW Eclipse Standard IDE for Developing Android Applications Install: 1.Java (JDK) – Since.
Threads, Surface Views and Real-Time Games. Background Most of the Android apps we’ve covered so far have been single threaded – And Event driven – An.
CE881: Mobile and Social Application Programming Simon M. Lucas Quiz, Walkthrough, Exercise, Lifecycles, Intents.
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
@2012 Android1 Java Review. Java  Java is an object-oriented language, with a syntax similar to C Structured around objects and methods A method is an.
Cosc 5/4730 Multimedia Part 1: Audio media. PLAYING AUDIO Android android.media.
Group 8: Dylan Lentini (AE), Mandy Minuti (WSE), Jean Paul Galea (TL)
Cosc 5/4730 Android media Part 2: Pictures and Video.
Implementation of an Android Phone Based Video Streamer 2010 IEEE/ACM International Conference on Green Computing and Communications 2010 IEEE/ACM International.
The Android Activity Lifecycle. Slide 2 Introduction Working with the Android logging system Rotation and multiple layouts Understanding the Android activity.
Cannon Game 1 Fall 2014 CS7020: Game Design and Development.
Camera. Make new project – Give permission to use camera Make button called TakePicture Make button called ShowLastPic Add SurfaceView to layout – Surface.
Camera. Make new project – Give permission to use camera Make button called TakePicture Make button called ShowLastPic Add SurfaceView to layout – Surface.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
Video in Processing David Meredith Aalborg University.
Embedded Programming and Robotics
Description: iMotion HD is an intuitive and powerful time- lapse and stop-motion app for iOS. It allows you to easily make your own movie by taking photos.
Programming Your Android App Gourav Khadge
BY LINDA MOHAISEN MIKE ZIELINSKI The Tree Census Project.
Creating your stop motion video  1. Brainstorm your visuals  Discuss an “image” as a “scene.” Your image should be focused on, and should describe the.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
CS378 - Mobile Computing Intents.
CS378 - Mobile Computing Web - WebView and Web Services.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Chapter 6 Publishing to the iPad. Installing Software for Working with the iPad When you create layout in InDesign, you can use the Adobe Content Viewer.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
1 Enter rotation angle Click Rotate for rotate and flip options.
UFCFS D Technologies for the Web Unity 3D: Review of Topics and Related Concepts.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Camera. Make new project – CameraFun – Give permission to use camera write_external _storage Make two buttons – id takePictureButton – id showLastPicButton.
Mobile Device Development Camera and Sensors Dr.YingLiang Ma.
UFCEK-20-3Web Games Programming Unity 3D: Review of Topics Publishing for the Web.
Multimedia Capture & storage. Introduction A rich set of API for recording of audio & video. A developer has two choices  launch the built-in app using.
Camera. Make new project – Give permission to use camera Make button called TakePicture Make button called ShowLastPic Add SurfaceView to layout – Surface.
Document Camera Welsh Video Network Support Centre © The JNT Association 2001.
Android media Part 2: Pictures and Video
CS378 - Mobile Computing Audio.
HTC Android Projector User Guide v Agenda Setup and Demo Environment Launch Projector Installer Launch Projector Application Q&A.
Build Cycle 5.  Themes  US Presidents  Custom Images  Number of Moves Made  Posting to Facebook.
Class on Fragments & threads. Fragments fragment is a modular section of an activity, which has its own lifecycle, receives its own input events, and.
How to Recover Deleted Photos from Android Cell Phone? Android is keeping on improving their products and make sure to provide the best software service.
By: Eliav Menachi.  Android custom 2D graphics library  OpenGL ES 1.0 for high performance 3D graphics.
Services. What is a Service? A Service is not a separate process. A Service is not a thread. A Service itself is actually very simple, providing two main.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
JavaScript, Third Edition 1 SELECTION LIST Demo. JavaScript, Third Edition 2 Description This web page will edit the slection to ensure an option was.
School of Engineering and Information and Communication Technology KIT305/KIT607 Mobile Application Development Android OS –Permissions (cont.), Fragments,
Java for android Development Nasrullah Khan. Using instanceof in Android Development the classes such as Button, TextView, and CheckBox, which represent.
The Doodlz app enables you to paint by dragging one or more fingers across the screen. The app provides options for setting the drawing color.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Introduction to Android Programming
Presenter: Tyler Newsome
IBall Face2Face CHD 12.0 Webcam
Vijay Kumar Kolagani Dr. Yingcai Xiao
Android Application Audio 1.
Accessing the device native APIs
USB cameras 4 distinct USB camera functions GPhoto2 vs Video4Linux2
Camera.
Lecture 8: Graphics By: Eliav Menachi.
Sensors, maps and fragments:
Android 16: Input Events Kirk Scott.
Funny Face Application
Cannon Game App Android How to Program
Lecture 8: Graphics By: Eliav Menachi.
Activities and Fragments
Presentation transcript:

- Rohit Vobbilisetty

What is the Camera API Capture Photos Capture Videos Camera API - Android2

Before starting Declare the permissions in the Android Manifest Camera Usage: Camera Features: Camera Auto-Focus: Write to External Storage: Camera API - Android3

Camera API Overview Primary API for controlling device cameras. Used to capture pictures and videos. Package: android.hardware.Camera Methods: Camera.open() – Obtain an instance startPreview() – Starts the Camera preview takePicture() – Takes a picture stopPreview() – Stops the Camera preview release() – Releases the camera getParameters() – Zoom, Image Quality, Location Information Camera API - Android4

Camera API – Capture Photo Detect and Access Camera Create a Preview Class Build a Preview Layout Setup Listeners for Capture Capture and Save Files Release the Camera Camera API - Android 5

Camera API – Capture Photo Detect and Access Camera Check for an existing Camera and obtain reference. Detect if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){ // this device has a camera return true; } else { // no camera on this device return false; } Access Use camera.open() to obtain a reference to the Camera. An exception implies Camera is in use or does not exist. Camera c = null; try { c = Camera.open(); // attempt to get a Camera instance } catch (Exception e){ // Camera is not available (in use or does not exist) } Use Camera.getParameters() to obtain the Camera capabilities. Camera API - Android6

Camera API – Capture Photo Create a Preview Class and Preview Layout Surface View (android.view.SurfaceView ) Provides a dedicated surface Is Z- ordered, so useful for overlaying buttons over this surface SurfaceHolder.Callback (interface) (android.view.SurfaceHolder.Callback) Receives information about changes to the surface (SurfaceView). Methods: surfaceCreated() surfaceChanged() surfaceDestroyed() Camera API - Android7

Camera API – Capture Photo Create a Preview Class and Preview Layout A Preview Class is a SurfaceView that can display live image data coming directly from the Camera. Create a class that extends SurfaceView and implements Surfaceholder.Callback.. Override the methods surfaceCreated(), surfaceChanged() and surfaceDestroyed() Preview Layout: Relative Layout with a Frame Layout to display the Camera Preview, and a Button which will trigger the capture. Camera API - Android8

Camera API – Capture Photo Setup Listeners for Capture Attach an OnClick Listener to the button. This listener should call takePicture(). NOTE: The method takePicture() requires the instance of PictureCallback as an argument. Camera API - Android9

Camera API – Capture Photo Capture and Save Files Create an instance of PictureCallback() and override the method onPictureTaken(). This method includes the logic to save the image to a file. Once the picture is taken, the method onPictureTaken() is called. Camera API - Android10

Camera API – Capture Photo Release the Camera Release the Camera by calling Camera.release(), once the application does not require it or on application exit. Camera API - Android11

Camera API – Capture Photo Orientation and Rotation The Camera Previews Orientation depends on the Orientation and Rotation of the device. Orientation (Portrait OR Landscape) getResources().getConfiguration().orientation Rotation activity.getWindowManager().getDefaultDisplay().getRotation(); Returns: ROTATION_0, ROTATION_90, ROTATION_180, ROTATION_270 Set the Camera Preview Orientation using Camera.setDisplayOrientation(angle). Camera API - Android12

Camera API – Capture Photo Orientation and Rotation Orientation: Landscape Rotation: ROTATION_270 Fix: Set the Camera Preview Orientation using Camera.setDisplayOrientation() If(Orientation=Landscape & Rotation=ROTATION_270){ Camera.setDisplayOrientation(180). } Camera API - Android13

Camera API – Capture Photo Diagram Camera API - Android14 Camera Preview surfaceCreated() surfaceChanged() surfaceDestroyed() Camera Preview surfaceCreated() surfaceChanged() surfaceDestroyed() Activity new CameraPreview(Camera) Button Event Handler Activity new CameraPreview(Camera) Button Event Handler Layout FrameLayout and Button Device Camera

Additional Features Zoom (API level 8) GPS Data Video Snapshot (API level 14) Face Detection (API level 14) Camera API - Android15

Demo Camera API - Android16

References Android Developer – Camera API StackOverflow Vogella.com – Camera API Camera API - Android17

Questions ?? Camera API - Android18

Thank You Camera API - Android19