I try to write a small Android program, which tells me the distance from a fix point. When the distance of the device and the fix point is below 100meters, a phone plays a sound.
if (distance<100){mySound.Play()};
It's OK, the sound starts, but when the GPS send the new coordinates, and the distance is below 100meters again, the mySound starts again and again in each second. The Sound should be played only one, when the the distance decrase below 100metes at First time. Any advice? Thx!
Aucun commentaire:
Enregistrer un commentaire