Hasper Ong

  1. The plugins require maven

Follow steps below to fix the problem

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

You are done

--

--

  1. Using Thread to delay the function to be run after certain hour.
import android.os.Handler;
...
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
// Do something after 5s = 5000ms
}
}, 5000);

2. CountDownTimer to delay

new CountDownTimer(30000, 1000) {
public void onFinish() {
// When timer is finished
// Execute your code here
}

public void onTick(long millisUntilFinished) {
// millisUntilFinished The amount of time until finished.
}
}.start();

3. Timer to delay

new Timer().schedule(
new TimerTask(){

@Override
public void run(){

//if you need some code to run when the delay expires
}

}, delay);

You are done

--

--

Hasper Ong

Hasper Ong

i am mobile developer, i love to share story, and of course i love to write story.