Monday , December 10 2018
Home / Android / Android Simple Graphics Example

Android Simple Graphics Example

The android.graphics.Canvas can be used to draw graphics in android. It provides methods to draw oval, rectangle, picture, text, line etc.

The android.graphics.Paint class is used with canvas to draw objects. It holds the information of color and style.

In this example, we are going to display 2D graphics in android.
1) activity_main.xml

 
2) MainActivity.java

 

Preview:-

simplegraphicsoutput1

About admin

Check Also

Android Activity Launch Modes

Launch mode is an instruction for Android OS which specifies how the activity should be ...

Leave a Reply