Skip to content

bmutinda/BataTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

BataTime

A simple Android Timer library

Getting started

A library should be small, right?!!! :)

Copy the two java files in the Library dir and paste them in your project package and you are good to go

How to use

You can do this in two ways:

1: Without tick timer - uses default tick time 500 miliseconds
int timeMiliseconds = 2000;
new BataTime(timeMiliseconds).start( new BataTimeCallback() {
    @Override
    public void onUpdate(int elapsed) {
        Log.e( TAG, "On update called...time elapsed = "+elapsed );
    }

    @Override
    public void onComplete() {
        Log.e( TAG, "On complete called..." );
    }
});
2: With tick timer
int timeMiliseconds = 2000; // in milliseconds = 2seconds 
int tickTime = 1000; // in milliseconds - 1 second - we trigger onUpdate in intervals of this time 
new BataTime(timeMiliseconds, tickTime).start( new BataTimeCallback() {
    @Override
    public void onUpdate(int elapsed) {
        Log.e( TAG, "On update called...time elapsed = "+elapsed );
    }

    @Override
    public void onComplete() {
        Log.e( TAG, "On complete called..." );
    }
});

Projects using this library

1: Jifunze Android app - App on Google Play

2: Kamba Music - App on Google Play

About

A simple Android Timer library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages