Vibration settings

Put your problem here if it does not fit any of the other categories.

Vibration settings

Postby scotta01 » Wed Jul 07, 2010 10:53 am

Hi guys, wonder if any of you can help?

I am trying to find out how to change the default vibrate pattern for incoming calls, SMS etc. I know how to create my own custom vibration and have it vibrate onClick() or in my own notifications but do not know where to override the incoming call setting. I thought AudioManager.setVibrateSetting would have been it, but that only allows on, off or silent only.

Is there any system wide setting I can change so that I can use my own vibration pattern?

Thanks.
scotta01
Freshman
Freshman
 
Posts: 8
Joined: Fri Feb 19, 2010 1:44 pm

Top

Re: Vibration settings

Postby scotta01 » Wed Jul 07, 2010 12:19 pm

Thanks anarche, I already use those settings to create a custom pattern but I am looking to use this pattern to override the incoming calls etc, which this doesn't cover. I know I could write a service to monitor and intercept the events but that would be a bit of a battery hog, I mlooking for a system setting I can overwrite.
scotta01
Freshman
Freshman
 
Posts: 8
Joined: Fri Feb 19, 2010 1:44 pm

Re: Vibration settings

Postby blundell » Wed Jul 07, 2010 1:35 pm

You have to use a Broadcast receiver or something, register your activity to be notified when an incoming call is..incoming.

http://androidboss.com/android-braodcast-receivers/
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: Vibration settings

Postby scotta01 » Wed Jul 07, 2010 2:21 pm

blundell wrote:You have to use a Broadcast receiver or something, register your activity to be notified when an incoming call is..incoming.

http://androidboss.com/android-braodcast-receivers/



Thanks very much, I was hoping that I could avoid having the app running all the time, but if that is the only way then so be it. Thanks for the help.
scotta01
Freshman
Freshman
 
Posts: 8
Joined: Fri Feb 19, 2010 1:44 pm

Re: Vibration settings

Postby anarche » Thu Jul 08, 2010 12:11 am

A BroadcastReceiver doesn't actually run all the time in the "chewing up resources" kinda way - thats a Service. It more just kinda sits there (I'm a little hazy on the exact implementation..) and when the event is fired the Receiver class is instantiated and onReceive() called...

EDIT: Try this out, but don't be surprised if you receive two lots of vibrations - the system one and your listener one.
anarche
Master Developer
Master Developer
 
Posts: 369
Joined: Sun Apr 11, 2010 5:21 am

Top

Re: Vibration settings

Postby wafj1984 » Thu Jul 08, 2010 2:36 am

Broadcast
wafj1984
Freshman
Freshman
 
Posts: 2
Joined: Thu Jul 08, 2010 2:33 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 19 guests