Android Lightweight Timer

Introducing: LightweightTimer. LightweightTimer allows to schedule tasks for repeated future execution. It pretty much serves the same purpose of Java’s Timer class, but does not require extra thread creation. Instead, LightweightTimer uses Android’s Handler class to schedule its tasks. This is important when creating Android apps because memory is at a premium, and creating a thread for every little repeating task you have seems wasteful. Also, the LightweightTimer has the added benifit of executing on the main thread, which is often what you want.

It’s super easy to use:

Leave a Reply

Your email address will not be published. Required fields are marked *