Christian Eric Paran
Christian Eric Paran

Reputation: 1010

how to determine what touched the screen of my android device?

I mean i want to know what touched the screen of my android device? Like if a FINGER touched the screen it would know it was a finger, if a ballpen, pencil, notebook, or something it would know that it wasnt a FINGER.

How does touchscreen determine the things that touched it? because i want to develop a FINGERPRINT SCANNER. what technique do i use? is there a android function that determine what thing touched the screen?

Thanks.

I can't explain it well, but i hope you got the idea.

Upvotes: 6

Views: 1677

Answers (4)

Stark
Stark

Reputation: 2611

Unfortunately, our touchscreen technology used on phones today is not that advanced, Yet. Of course, I would like to build a biometric security unlock app on Android too ;)

Upvotes: 0

Jack Satriano
Jack Satriano

Reputation: 2029

You can do this quite easily with API 14:

myView.setOnTouchListener(new Button.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent arg1) {
                     if (arg1.getAction() == android.view.MotionEvent.ACTION_DOWN
                              && (MotionEvent.TOOL_TYPE_FINGER == arg1.getToolType(0)) {    
                        Toast.makeText(this,
                                        "You touched me with your finger!",
                                        Toast.LENGTH_LONG).show();
                    }
                     return true;
                }
        });

Really only tells you that a touch input was given, but differentiates from styluses and mouse pointers. Most devices use thermal detection for touch input, but some devices out there have been made to simulate finger input. Ex. SmartPhone Gloves, Ipad Stylus

Upvotes: 0

Cat
Cat

Reputation: 67502

Touchscreens don't determine what touches them.

In the case of resistive touchscreens, they go solely based on pressure of the tool pushing down. (These are a bit out of date, and I'm not aware of any Android devices that use this type of touchscreen.)

Capacitive touchscreens, as you may have guessed, use capacitors and electric currents to determine when they are touched. Since the human body's skin is a conductor, it signals that the screen has been touched. However, they develop styluses that are also conducive, so those set it off as well. However, the screen does not know the difference between these; they're just both conductors of electricity.

You cannot determine the precise shape of a fingerprint through the touchscreen technology on smartphones. You can determine the pressure of the touch, the major and minor axes of the ellipse that represents the touch area, or the approximate size of the touch. Nothing more.

Upvotes: 0

Shoaib Ahmed
Shoaib Ahmed

Reputation: 781

your devices screen got no such sensors to determine the type of touch ..

Upvotes: 1

Related Questions