I woke up today to find a TribalWars incoming attack notification on my phone, and then soon found out that my troops were cleared during the night on TribalWars. I didn't want to send the troops away before going to sleep as that is not only inconvenient but also leaves my resources open to be plundered and my villages open to be nobled. This motivated me to build a solution to deal with attacks during the night in order to solve these problems.
No-one wants to be woken up unless it is urgent, and for any serious TribalWars player being attacked is a matter of urgency. The notification sound is probably not enough to wake you up, and if it was then it might be for something that is not urgent. This is where my app comes in, when new notifications come in and it is between 10pm and 10am then it will check them to see if they are a TribalWars incoming attack and if they are then it will play the default alarm sound continuously, even when the phone is on silent mode. Once the attack notification is dismissed then the ringtone will stop playing.
Note: To get it to work you need to allow my app to read notifications under Settings -> More -> Security -> Notification Access.
This is only the beginning of the app and and I welcome your feedback and suggestions as to how it could be improved. Here are some improvements which I am already looking to implement in future:
- Set sleep and wake up times between which the attack alarm should go off
- Set custom media file to be used for the attack alarm
- Set if alarm should go off as soon as attack alarm goes off or at specific time, because night mode means that you may not need to wake up until just before it ends.
Fixed a bug where on some devices the alarm sound would play once instead of playing continually.