I’m trying to make an android app only for tablets, which will draw the lines as and where the user touches the screen. It is very simple and there are lot more apps like this. I have a doubt regarding the touch-screen technology. Is there any possibility that if the user touch the screen soft then the lines will be dull and if the user touch the screen harder then the lines drawn will be thicker? Is it even possible to do such things in tablet? I don’t have info about the hardware and technology used in tablets, please guide me with a valid answers and please refer me to any blogs or docs which says about the touch sense technology.
Thank you
I’m trying to make an android app only for tablets , which will draw
Share
You can use the OnTouch() Input Event (http://developer.android.com/guide/topics/ui/ui-events.html) which is triggered when you touch the screen. So inside the VIEW in your application you should register an OnTouchListener using setOnTouchListener (setOnTouchListener) with a callback to the function that will handle the event.
Inside your callback get the pressure properties:
http://developer.android.com/reference/android/view/MotionEvent.PointerCoords.html#pressure
When you touch the screen you get a MotionEvent which has many methods and one of them gives you the pressure
http://developer.android.com/reference/android/view/MotionEvent.html