Graphics & Animation in Android. Android rendering options The Canvas API Renderscript OpenGL wrappers NDK OpenGL

Slides:



Advertisements
Similar presentations
The Ludei platform Iker Jamardo HTML5 LA 2013/06/10.
Advertisements

David Meredith Android: Animation David Meredith
FireMonkey Deep Dive The Next Generation of Business Application Development.
Introduction to Android Mohammad A. Gowayyed CS334-Spring 2014.
Charis Marangos. Games versus Most Applications  Technical implementation is hard Real-time and responsive (at least 25 frames per second) Hungry for.
CS378 - Mobile Computing 3D Graphics.
 The success of GL lead to OpenGL (1992), a platform-independent API that was  Easy to use  Close enough to the hardware to get excellent performance.
Android View Properties & Animations
Lecture21 Other Java Gamming technologies – Java3D (This lecture will not be assessed)
Mobile Application Development
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
CS 201 Functions Debzani Deb.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Overview of Computer Graphics Chapter 1. Bird’s Eye View  Overview of Computer Graphics –Basic concept of computer graphics, system, programming platforms,
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics.
Basic Animation. Animation 4 options – Animated.gif – Frame by Frame animation – Tweened animation This is our focus – OpenGL ES Graphics API for more.
Custom Views, Drawing, Styles, Themes, ViewProperties, Animations, oh my!
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Lecture Series on Android Programming Lecturer: Prof.Luqun Li Teaching Assistants: Fengyou Sun, Haijun Yang, Ting.
MACHINE VISION GROUP Graphics hardware accelerated panorama builder for mobile phones Miguel Bordallo López*, Jari Hannuksela*, Olli Silvén* and Markku.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Android How to Program Presented by Thomas Bucag, Rob Goodfellowe, Samantha Tomeï © by Pearson Education, Inc. All Rights Reserved.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
GPUs and Accelerators Jonathan Coens Lawrence Tan Yanlin Li.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
OpenGL Shading Language (Advanced Computer Graphics) Ernest Tatum.
1 Chapter 1 Overview of Computer Graphics  To understand the basic objectives and scope of computer graphics  To identify computer graphics applications.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
ROOT Team Meeting October 1 st 2010 GUI thinking and testing ideas OpenGL GUI Root Team meeting 01/10/2010.
PVSSProxy The first piece of the MACS procedure framework (ProShell) Angela Brett.
GPU Architecture and Programming
Multimedia System and Networking UTD Slide- 1 University of Texas at Dallas B. Prabhakaran Rigging.
Android Graphics Library. Color Android colors are represented with four numbers, one each for alpha, red, green, and blue (ARGB). Each component can.
The System Shall… Provide the ability to render 2D/3D graphics, these graphics will be represented by assets like models textures, and shaders. Manage.
INTRODUCTION GORT is a virtual 3D modeling environment for computer programmers. Its main area of focus is to aid in the education of programmers learning.
Mobile Programming Lecture 11 Animation and TraceView.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Application Software System Software.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
CS378 - Mobile Computing 3D Graphics.
Basic Animation. Animation 4 options – Animated.gif – Frame by Frame animation – Tweened animation This is our focus – OpenGL ES Graphics API for more.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
TODAY Android Studio Installation Getting started Creating your 1 st App Beginning to understanding Intents.
A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and Applications software. Systems.
Basic 2D Graphics in Android. Android Graphics Programming There are many ways to do graphics programming in Android – 2D vs. 3D – static vs. dynamic.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
By: Eliav Menachi.  Android custom 2D graphics library  OpenGL ES 1.0 for high performance 3D graphics.
CHAPTER 5 Graphics Drawing Audio. Chapter objectives: Learn to draw to a canvas Examine the process of adding drawn elements and UI controls to a layout.
Lecture 3: Animation & Graphics Topics: Animation, Graphics, Drawing Date: Feb 2, 2016.
Graphics & Animation Radan Ganchev Astea Solutions.
Android.
Computer Engg, IIT(BHU)
Lecture 3: Animation & Graphics
Graphics & Animation in Android
Introduction: From Nand to Tetris
Lecture 3: Animation & Graphics
Lecture 8: Graphics By: Eliav Menachi.
Microcomputer Programming
Unit 20 Software Part 2.
Unit 20 Software Part 2.
3D applications in Delphi
Inheritance Inheritance is a fundamental Object Oriented concept
Lecture 3: Animation & Graphics
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer Low level programming language: A programming.
Computer Graphics Lecture 15.
Emerging Platform#3 Android & Programming an App
Lecture 8: Graphics By: Eliav Menachi.
CS297 Graphics with Java and OpenGL
Procedure for Developing a Multimedia Presentation
Presentation transcript:

Graphics & Animation in Android

Android rendering options The Canvas API Renderscript OpenGL wrappers NDK OpenGL

The Canvas API Standard rendering for a typical SDK application that uses View objects (standard and custom) consists of calls to each View's onDraw() method. This method takes a single parameter, Canvas, which is the object used by the view to draw its content.

Renderscript Introduced in Android 3.0 API targeted high-performance 3D rendering and compute operations a 3D rendering API on top of hardware acceleration, language C99 executing native code on the device still cross- platform use of extensions that are placed into the application package

Renderscript Live Wallpapers, the video wall view in the YouTube application, and the Books application (including that beautiful page-turn effect).

Open GL Wrappers OpenGL APIs at the SDK level not a recommended practice as a general approach for complex scenes that require high-performance graphics difficult to achieve high performance levels equivalent to native access to OpenGL due to the overhead of calling down from the SDK Music application that shipped with Android 3.0 used this approach

NDK OpenGL no access to the View objects, or the events, or the rest of the infrastructure that is provided in the SDK APIs graphics environment sufficient for some specific purposes: game developers compiles applications to specific CPU architectures

Animations Animations prior to Android 3.0 – android.view.animation – move, scale, rotate, and fade Views – combine multiple animations together in an AnimationSet – specify animations in a LayoutAnimationController to get automatically staggered animation – use Interpolator implementations like AccelerateInterpolator and Bounce to get natural, nonlinear timing behavior

Animations Animations prior to Android 3.0 – you can animate Views... and that's it – How to animate the position of a Drawable in a custom drawing? Or translucency? – you can move, rotate, scale, and fade a View... and that's it. – animating the background color of a View? – hard-coded set of things they were able to do, and you could not make them do anything else.

Animations Animations in Android 3.0 – not specific to Views – animates values over time – assigning those values to any target objects and properties er_embedded&v=-9nxx066eHE#! er_embedded&v=-9nxx066eHE#!

Animations Animator – superclass for classes which provide basic support for animations which can be started, ended, and have AnimatorListeners added to them java.lang.Object ↳ android.animation.Animator ↳ android.animation.AnimatorSet java.lang.Object ↳ android.animation.Animator ↳ android.animation.ValueAnimator ↳ android.animation.ObjectAnimator

Animations AnimatorSet – choreograph multiple animators together into a single animation – animations can be set up to play together, in sequence, or after a specified delay – “It is possible to set up a AnimatorSet with circular dependencies between its animations… results of this configuration are undefined… circular dependencies should be avoided”

Animations ValueAnimator – runs the internal timing loop that causes all of a process's animations to calculate and set values – two pieces to animating properties: calculating the animated values and setting those values on the object and property in question. ValueAnimator takes care of the first part; calculating the values

Animations ObjectAnimator – takes care of the second part : setting animating values on the object and property – main class in the new animation system ObjectAnimator.ofFloat(myObject, "alpha", 0f).start(); public void setAlpha(float value); public float getAlpha();

View properties – added new properties to the View class in Honeycomb translationX and translationY rotation, rotationX, and rotationY scaleX and scaleY pivotX and pivotY x and y alpha Animations

AnimatorSet – choreograph multiple animations ObjectAnimator fadeOut = ObjectAnimator.ofFloat(v1, "alpha", 0f); ObjectAnimator mover = ObjectAnimator.ofFloat(v2, "translationX", - 500f, 0f); ObjectAnimator fadeIn = ObjectAnimator.ofFloat(v2, "alpha", 0f, 1f); AnimatorSet animSet = new AnimatorSet().play(mover).with(fadeIn).after(fadeOut); Animations

TypeEvaluator – The system knows how to animate float and int values, but otherwise it needs some help knowing how to interpolate between the values you give it – add this interface to the ValueEvaluator Interface TypeEvaluator { public abstract T evaluate (float fraction, T startValue, T endValue) } Animations