• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Programming a target in an Android Application

kingh32

Lurker
Hello

I'm currently trying to program a target as part of an Android Application.
I want the user to be able to touch a particular band within the target with the app being able to acknowledge the area selected i.e. coordinates and put that data into a database.

Does anyone have any suggestions as to how I can make an image of a target function in this way?

The target is made up of 6-9 bands, each being the same width.

Thanks

Kingh32
 
You can measure the distance between the center of your target and the touching point. That way you can calculate which band has been hit.

hitBand = Math.floor(distance / bandWidth);

~id
 
Back
Top Bottom