setting custom vibration profile on screen touch
i am trying to detect a screen touch on my cu开发者_Python百科rrent application such that when the user touches a part of the screen
my app basically retrieves a text file from the SD card and display's the text in the file onto a textview
is it possible for me to append a customize vibration pattern to the text upon touch
For example, "HELLO" is retrieved from the text file and display via textview
when i touch on the individual characters, a preset vibration is used
i am using this to achieve the vibrations with all the various patterns set.
vibrator.vibrate(pattern101, -1);
I would use a SurfaceView/Canvas for this. Then you have to manage the bounds of each of the character of the text is, and if the finger is within the bounds for that character, play the vibration pattern for that character.
An alternative would be to create a textview/imageview for each character, and add an onTouchListener to each one.
Good luck with your Braille-app. ;-)
精彩评论