JDNdeveloper / Off-By-One

CMPS 115 Project: Jayden Navarro, John Gemignani, Alex Gonzalez, Kevin Cheng, Josh Innis
0 stars 0 forks source link

Fix vibrate, ringtone and notification sound #32

Closed JDNdeveloper closed 9 years ago

JDNdeveloper commented 9 years ago

Hey Alex. I just tried using the new Phone class functionality and it breaks currently. I'm not sure why, but even just trying to get it to vibrate doesn't work. The only function that doesn't break it is the sendNotification one.

JDNdeveloper commented 9 years ago

I think this may be due to the permissions required in the manifest.

JDNdeveloper commented 9 years ago

Okay, I added in the vibrate permission, but this didn't fix the issue.

JDNdeveloper commented 9 years ago

A couple of things that I discovered.

  1. Vibrate is the only one that breaks it.
  2. Ringtone and NotificationSound don't break it. You just said r.stop() too soon for both of them.
  3. Don't use r.stop() for NotificationSound, only for ringtone. You just need to figure out how to do it properly for the ringtone, otherwise it will play forever. But if you put r.stop() right after r.play() then it won't play at all.