Saturday, 7 September 2013

How to measure the time proximity sensor is registering near in android

How to measure the time proximity sensor is registering near in android

How would I measure how long my finger has been in front of the proximity
sensor? I am making a mp3 player app and right now when I wave my hand
over the sensor it changes songs. I wanted to add the functionality of
holding it over the sensor for a couple seconds to pause it and likewise
to unpause it. I have a feeling I should use system.currentTimeMillis(),
but I am not sure how to implement it.

No comments:

Post a Comment