CSC 234 - Project 2

DrawTouch

Assigned Jan 22
Due Jan 28 Beginning of Class


This assignment creates a drawing program, where you can draw circles to the screen by touching and dragging, and it will report the Area and Perimeter of the circle to the user.

First, create a new Android Project called DrawTouch. Use the package edu.centenary.USERNAME.drawtouch and select Android SDK version 17.

Copy the following DrawTouchActivity.java file into the package you created under the src directory. This is the controller which runs the application.

Copy the icon ic_launcher.png file into the res/drawable-hdpi directory. This is the icon for your application.

To complete this project, you will need to make a MyCircle class that has the following structure:

First, import the library for android.graphics.RectF. This is how Android represents a rectangle for drawing objects to the screen. It has floats as data members for the left, top, right, and bottom boundaries.

You will need three data members, one to keep track of the x coordinate of the center of the circle, one to track the y coordinate of the center, and one to track the radius of the circle.