Android Question Converting from Tasker

pi_kano

New Member
Hi, I'm new to Basic4Android, but I have experience of Visual Basic Programing. Some time ago I wrote an App in Tasker, which allows me to mute the phone (all sounds) for 30/60/90/120 minutes, by pressing the appropriate button, after which time the phone is unmuted.

I want to re-create this app, to teach myself Basic4Android, but I'm having a problem getting my head around the timing aspect of it and the muting. Any help would be welcome :)

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
See Services. See ServiceStartAt to reshedule the service at a given time. Search for code for muting in forum. I´m sure you will find something
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can mute a single volume channel with Phone.SetMute. You can change the ringer mode with Phone.SetRingerMode.

You should use StartServiceAt to schedule a service to start in x minutes and unmute the phone. You can use DateUtil.AddPeriod to find the correct time:
http://www.b4x.com/android/forum/threads/26290/#content
 
Upvote 0
Top