Book description
Pro Android Graphics is a comprehensive goldmine of knowledge and techniques that will help you design, create, and optimize 2D graphics for use in your Android Jelly Bean applications. Android application developer and expert multimedia producer Wallace Jackson of Mind Taffy Design shows you how to leverage Android's powerful graphics APIs in conjunction with professional open source graphics design tools such as GIMP 2.8.6 and more.
You'll learn about:
The foundational graphics concepts behind the three core new media areas (digital imaging, digital video, and 2D animation) which relate to graphics design, and how to optimize these new media assets for your Android applications across iTVs, tablets, eReaders, game consoles, and smartphones.
Digital imaging techniques for Android apps design, including graphics design layouts and graphical user interface elements, and how to use image compositing techniques to take your digital imaging to far higher levels.
Advanced image compositing and blending techniques, using Android's PorterDuff, NinePatch, and LayerDrawable classes.
Advanced 2D animation techniques, using Android's Animation and AnimationDrawable classes.
Digital video optimization, playback, and streaming, using open source 3D (Terragen 3) and video (VirtualDub) applications, as well as professional video editing applications such as Squeeze Pro 9. You'll use these software packages with Android's VideoView and MediaPlayer classes, and add compositing to enhance your end-users' digital video experience.
What you'll learn
How to build graphics rich Android apps and games
What are the key Android Graphics support APIs: Images, Animation and Video Concepts
What are the digital imaging techniques for Android apps
What are the advanced animation techniques for Android apps
How to do digital video optimization for Android apps
Who this book is for
Pro Android Graphics is written for experienced Android developers and advanced multimedia artisans, especially those who want to create rich, vibrant-looking graphics-related applications.
Table of contents
- Title Page
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Acknowledgments
-
Chapter 1: Android Digital Imaging: Formats, Concepts, and Optimization
- Android’s Digital Image Formats: Lossless Versus Lossy
- Android View and ViewGroup Classes: Image Containers
- The Foundation of Digital Images: Pixels and Aspect Ratio
- The Color of Digital Images: Color Theory and Color Depth
- Representing Colors in Android: Hexadecimal Notation
- Image Compositing: Alpha Channels and Blending Modes
- Digital Image Masking: A Popular Use for Alpha Channels
- Smoothing Edges in a Mask: The Concept of Anti-Aliasing
- Optimizing Digital Images: Compression and Dithering
- Download the Android Environment: Java and ADT Bundle
- Installing and Updating the Android Developer ADT Bundle
- Summary
-
Chapter 2: Android Digital Video: Formats, Concepts, and Optimization
- Android Digital Video Formats: MPEG4 H.264 and WebM VP8
- Android VideoView and MediaPlayer Class: Video Players
- The Foundation of Digital Video: Motion, Frames and FPS
- Digital Video Conventions: Bit Rates, Streams, SD, and HD
- Digital Video Files for Android: Resolution Density Targets
- Optimizing Digital Video: Codecs and Compression
- Creating Your Pro Android Graphics App in Eclipse ADT
- Creating Your Video Start-Up Screen User Interface Design
- Taking a Look at Your MainActivity.java Activity subclass
- Creating Your Video Assets: Using Terragen 3 3D Software
- Creating Uncompressed Video: Using VirtualDub Software
- Compressing Your Video Assets: Using Sorenson Squeeze
- Installing a Video Asset in Android: Using the Raw Folder
- Referencing the Video Asset in Your Android Application
- Summary
-
Chapter 3: Android Frame Animation: XML, Concepts, and Optimization
- Frame Animation Concepts: Cels, Framerate, and Resolution
- Optimizing Frame Animation: Color Depth and Frame Rate
- Creating Frame Animation in Android Using XML Markup
- Android <animation-list> Tag: The Parent Frame Container
- Android’s <item> Tag: Specifying Your Animation Frames
- Creating a Frame Animation for our GraphicsDesign App
- Copying Resolution Density Target Frames
- Creating Frame Animation Definitions Using XML
- Reference the Frame Animation Definition in an ImageView
- Instantiating the Frame Animation Definition Using Java
- Summary
-
Chapter 4: Android Procedural Animation: XML, Concepts, and Optimization
- Procedural Animation Concepts: Tweens and Interpolators
- Procedural Animation Data Values: Ranges and Pivot Point
- Procedural Animation Transforms: Rotate, Scale, Translate
- Procedural Animation Compositing: Alpha Blending
- Procedural Animation Timing: Using Duration and Offsets
- Procedural Animation Loops: RepeatCount and RepeatMode
- The <set> Tag: Using XML to Group Procedural Animation
- Procedural Animation vs. Frame Animation: The Trade-Off
- Creating Procedural Animation in your GraphicsDesign App
- Creating a Procedural Animation Definition Using XML
- Instantiating the Animation Object in MainActivity.java
- Using Set to Create a More Complex Procedural Animation
- Rotation Transformation: Going a Bit Too Far with FX
- Tweaking Transform Values: The Ease of Adjusting XML
- Summary
-
Chapter 5: Android DIP: Device-Independent Pixel Graphics Design
- How Android Supports Device Displays: UI Design and UX
- Device Display Concepts: Size, Density, Orientation, DIP
- Density Independence: Creating Similar User Experiencesl
- Android Multi-Screen Support Via <supports-screens> Tag
- Providing Device-Optimized User Interface Layout Designs
- Providing Device-Optimized Image Drawable Assets
- The DisplayMetrics Class: Size, Density, and Font Scaling
- Optimizing Android Application Icons for LDPI to XXXHDPI
- Installing the New App Icon in the Correct Density Folders
- Configuring the AndroidManifest.xml for Custom App Icon
- Testing the New Application Icon and Label on Nexus One
- Summary
-
Chapter 6: Android UI Layouts: Graphics Design Using the ViewGroup Class
- Android ViewGroup Superclass: A Foundation for Layouts
- The ViewGroup LayoutParams Class: Layout Parameters
- Deprecated Layouts: AbsoluteLayout and SlidingDrawer
- Android’s Experimental Layout: SlidingPaneLayout
- Android RelativeLayout Class: Designing Relative Layouts
- Android LinearLayout Class: Designing Linear Layouts
- Android FrameLayout Class: Designing Frame Layouts
- Android GridLayout Class: Designing UI Layout Grids
- The DrawerLayout Class: Designing UI Drawer Layouts
- Adding Menu Items to Access the UI Layout Container
- Creating a Table of Contents Activity for Your UI Design
- Creating an XML Table of Contents LinearLayout UI Design
- Adding Text UI Widgets to the TOC UI Layout Container
- Using onOptionsItemSelected( ) to Add Menu Functionality
- Testing the Table of Contents Activity on the Nexus One
- Summary
-
Chapter 7: Android UI Widgets: Graphics Design Using the View Class
- The Android View Class: The Foundation for UI Widgets
- View Basic Properties: ID, Layout Positioning, and Size
- View Positioning Characteristics: Margins and Padding
- View Graphic Properties: Background, Alpha, and Visibility
- A View’s Functional Characteristics: Listeners and Focus
- Bookmark Utility UI: Using a RelativeLayout and TextView
- Using an ImageView Widget: The Cornerstone of Graphics
- Testing Your UI Design in the Nexus One Landscape Mode
- Adding a Drop Shadow Effect to an ImageView Image Asset
- Changing Your ImageView XML to Incorporate a New Asset
- Compositing a Background Image in Your RelativeLayout
- Summary
-
Chapter 8: Advanced ImageView: More Graphics Design Using ImageView
- Graphics in Android: The Origins of the ImageView Class
- The ImageView.ScaleType Nested Class: Scaling Control
- Using AdjustViewBounds and How it Relates to ScaleType
- MaxWidth and MaxHeight: Controlling AdjustViewBounds
- Setting a Baseline in ImageView and Controlling Alignment
- Using the CropToPadding Method to Crop Your ImageView
- Tinting an ImageView and Color Blending Using PorterDuff
- Apply Tint to SkyCloud Image to Improve Shadow Contrast
- Cropping Your SkyCloud Image Asset Using CropByPadding
- Changing the Baseline Alignment Index for Your ImageView
- Performing Image Scaling: Margins and Padding Attributes
- Summary
-
Chapter 9: Advanced ImageButton: Creating a Custom Multi-State ImageButton
- Button Graphics in Android: ImageButton Class Overview
- ImageButton States: Normal, Pressed, Focused, and Hovered
- ImageButton Drawable Assets: Compositing Button States
- An ImageButton Drawable: Setting Up the Multi-State XML
- Create All ImageButton State Assets: Density Resolutions
- Scaling the ImageButton Down to a UI Element-Like Scale
- Summary
- Chapter 10: Using 9-Patch Imaging Techniques to Create Scalable Imaging Elements
-
Chapter 11: Advanced Image Blending: Using Android PorterDuff Classes
- Pixel Blending: Take Image Compositing to the Next Level
- Android’s PorterDuff Class: The Foundation for Blending
- The PorterDuff.Mode Class: Android Blending Constants
- The PorterDuffColorFilter Class: Blending Your ColorFilter
- Applying ColorFilter Effects to Image Assets Using PorterDuff
- The PorterDuffXfermode Class: Apply Blending Constants
- The Paint Class: Apply a Blending Constant Onto an Image
- Using Bitmap Classes to Apply PorterDuff Between Images
- Using .setXfermode( ) Method to Apply PorterDuffXfermode
- The Canvas Class: Creating a Canvas for Our Compositing
- Creating an ImageView in XML and Java to Display Canvas
- Writing the Canvas to an ImageView Via .setBitmapImage( )
- Summary
-
Chapter 12: Advanced Image Compositing: Using the LayerDrawable Class
- Layer Drawables: Take Image Compositing to a New Level
- Android’s LayerDrawable Class: A Foundation for Layers
- The <layer-list> Parent Tag: Setting Up Layers Using XML
- Instantiating a LayerDrawable for PorterDuff Compositing
- Create a Drawable Object to Hold the LayerDrawable Asset
- Cast a Drawable to a BitmapDrawable and Extract a Bitmap
- Modifying the PorterDuff Pipeline to Use a LayerDrawable
- Switch LayerDrawable Image Asset: Source to Destination
- Changing the LayerDrawable Layer Used in Our Pipeline
- Exercise for the Reader: Using Two LayerDrawable Assets
- Some Final Digital Image Compositing Caveats in Android
- Summary
-
Chapter 13: Digital Image Transitions: Using the TransitionDrawable Class
- Transitions: Image Blending to Create an Illusion of Motion
- Android’s TransitionDrawable Class: A Transition Engine
- The <transition> Parent Tag: Setting Up Transitions in XML
- Instantiating ImageButton and TransitionDrawable Objects
- Using the .reverseTransition( ) Method for Pong Transitions
- Advanced TransitionDrawable Compositing via ImageView
- Summary
-
Chapter 14: Frame-Based Animation: Using the AnimationDrawable Class
- The AnimationDrawable Class: A Frame Animation Engine
- The DrawableContainer Class: A Multi-Drawable Drawable
- Creating Your AnimationDrawable Splashscreen Using Java
- Using the Android Runnable Class to Run Your Animation
- Creating a setUpAnimation( ) Method for Your Animation
- Creating a New AnimationDrawable Object and Referencing Its Frames
- Using the AnimationDrawable Class’s .addFrame( ) Method
- Configuring an AnimationDrawable by Using .setOneShot( )
- Scheduling an AnimationDrawable Using the Handler Class
- Designing an AnimationDrawable to Loop Back to Frame 1
- Adding Event Handling to Allow Frame Animation by Click
- Summary
-
Chapter 15: Procedural Animation: Using the Animation Classes
- The Animation Class: Your Procedural Animation Engine
- TranslateAnimation Class: Animation Subclass for Moving
- The ScaleAnimation Class: Animation Subclass for Scaling
- Scaling Up Your Logo: Using the ScaleAnimation Class
- AlphaAnimation Class: Animation Subclass for Blending
- Fading In Your PAG Logo: Using the AlphaAnimation Class
- The AnimationSet Class: Creating Complex Animation Sets
- Creating an AnimationSet for Your PAG Logo Animation
- RotateAnimation Class: Animation Subclass for Rotation
- Rotating Your PAG Logo: Using the RotateAnimation Class
- Using an Android Runnable Class to Run the AnimationSet
- Creating a TranslateAnimation Object for Your AnimationSet
- Summary
-
Chapter 16: Advanced Graphics: Mastering the Drawable Class
- Android Drawable Resources: Types of Drawable Objects
- Creating a ShapeDrawable Object: XML <shape> Parent Tag
- The Android Drawable Class: The Blueprint for Graphics
- Creating Your Custom Drawable: ImageRoundingDrawable
- Creating a Paint Object to Use to Paint the Drawable Canvas
- The Android Shader Superclass: Texture Maps for Painting
- The Shader.TileMode Nested Class: Shader Tiling Modes
- The BitmapShader Class: Texture Mapping Using Bitmaps
- Creating and Configuring a BitmapShader for the Drawable
- Android Rect and RectF Classes: Defining the Draw Area
- Defining Your RectF Object and Calling .drawRoundRect( )
- Summary
-
Chapter 17: Interactive Drawing: Using Paint and Canvas Classes Interactively
- The Android onDraw( ) Method: Drawing onto Your Screen
- The Android Canvas Class: The Digital Artisan’s Canvas
- The Android Paint Class: The Digital Artisan’s Paintbrush
- Setting Up Your GraphicsDesign Project for Your SketchPad
- Creating a Custom View Class: Your SketchPadView Class
- The Android Context Class: Telling Your Activity Where It Is
- Configuring Your SketchPadView( ) Constructor Method
- Creating a Coordinate Class to Track Touch X and Y Points
- The Java List Utility Class: Get Your Collections in Order
- Java’s ArrayList Utility Class: An Array of Collection List
- Creating an ArrayList Object to Hold Your Touch Point Data
- Implementing Your .onDraw( ) Method: Painting Your Canvas
- Creating Your OnTouchListener( ) Method: Event Handling
- Android’s MotionEvent Class: Movement Data in Android
- Processing Your Movement Data: Using .getX( ) and .getY( )
- Coding Your SketchPad Activity: Using the SketchPadView
- Testing the SketchPad Activity Class: Handwriting a PAG Logo
- Paint Using a Bitmap Source: Implementing Your InkShader
- Summary
-
Chapter 18: Playing Captive Video Using the VideoView and MediaPlayer Classes
- A Life of a Video: The Stages of a Video Playback Lifecycle
- Where Video Lives: The Data URI and Android’s Uri Class
- Android’s MediaPlayer Class: Controlling Video Playback
- The Android VideoView Class: The Video Asset Container
- Using the MediaPlayer Class: Looping a Video Seamlessly
- Setting Up Scaling Video Assets to Fit any Screen Aspect Ratio
- Optimizing Your Range of Video Asset Resolution Targets
- Using 16:9 Low Resolution 640x360 Digital Video Assets
- Using NetBook Resolution 1024x600 Digital Video Asset
- Using Low HD Resolution 1280x720 Digital Video Assets
- Using a True HD 1920x1080 Digital Video Asset for iTVs
- Analyzing Target Resolution Compression Ratio Results
- Using the WebM VP8 Codec to Compress Pseudo HD Video
- Using the WebM VP8 Codec to Compress True HD Video
- Summary
-
Chapter 19: Streaming Digital Video from an External Media Server
- Can I Stream Video? Setting a Manifest Internet Permission
- When Video Lives Far Away: The HTTP URL and Your URI
- The ProgressDialog Class: Show Your Download Progress
- Implementing a ProgressDialog in the GraphicsDesign App
- Testing the Progress Dialog: Dealing with Compiler Errors
- Streaming Digital Video Using the WebM VP8 Video Codec
- Making Your Video Playback App Aware of Its Orientation
- Android’s Display Class: Physical Display Characteristics
- The Android DisplayManager Class: Managing the Display
- Android’s WindowManager Interface: Managing a Window
- Setting Up a Display Object to Ascertain the Device Rotation
- Android’s Surface Class: Grab Your Display’s Raw Buffer
- Using a .getRotation( ) Method Call to Drive a Switch Loop
- Testing Streaming Video in Portrait and Landscape Orientations
- Some Caveats About Using Digital Video in Android
- Android’s DisplayMetrics Class: A Display’s Specifications
- Summary
- Index
Product information
- Title: Pro Android Graphics
- Author(s):
- Release date: October 2013
- Publisher(s): Apress
- ISBN: 9781430257851
You might also like
book
Pro Android Media: Developing Graphics, Music, Video, and Rich Media Apps for Smartphones and Tablets
Mobile devices have evolved to focus on rich media production and consumption. Developers of mobile applications …
book
Pro Android UI
If you're an Android application developer, chances are you're using fixed, scrolling, swipe-able, and other cutting-edge …
book
Android Application Development Cookbook: 93 Recipes for Building Winning Apps
A must-have collection of ready-to-use Android recipes! The popularity of Google Android devices is seemingly unstoppable …
book
OpenGL ES 2 for Android
Android is booming like never before, with millions of devices shipping every day. It's never been …