An app I am writing at the moment needs to have a periodic timer, i.e. a way to run a bit of code at regular intervals. After digging through different sources, I've found two recommended patterns to code such behaviour:
1. Using a periodic alarm: Android has