1. Check out our app, Forums for Android! Download and leave feedback here!

Programming a target in an Android Application

Discussion in 'Application Development' started by kingh32, Aug 2, 2010.

  1. kingh32

    kingh32 New Member
    Thread Starter
    25

    Aug 2, 2010
    2
    0
    25
    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
     

    Advertisement

  2. id0001

    id0001 Well-Known Member
    38

    Apr 20, 2010
    142
    23
    38
    Student.. also software developer
    Netherlands
    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
     

Share This Page

Loading...