Android 2D Graphics


  • Android Graphics 
  • Drawing 2D Graphics

Android 2D & 3D Graphics Support 

  • Android graphics are powered by 
    • A custom 2D graphics library 
    • OpenGL ES 1.0 for high performance 3D graphics. 
  • The most common 2D graphics APIs can be found in the drawable package. 
  • OpenGL APIs are available from the Khronos OpenGL ES package, plus some Android OpenGL utilities 
    • (We will cover 3D in another presentation)

Drawing 2D Graphics

Two Options of Drawing 2D Graphics 

  • Option #1 - Drawing into a View (or ImageView) 
    • Draw to the background of a View or to the content of an ImageView 
    • The drawing (and any animation) of your graphics is handled by the system's normal View hierarchy drawing process — you simply define the graphics to go inside the View.Option #2 – Draw your graphics directly to a Canvas yourself 
  • Option #2 – Draw your graphics directly to a Canvas yourself
  • You personally call the appropriate class's draw() method (passing it your Canvas), or one of the Canvas draw...() methods (like drawPicture())


You must have an active subscription to download PDF and Lab Zip of this course topic.Please click the "Subscribe" button or the "Login" button if you already have an account.