hi expert, i did wifi scanning for android, but now i want this wifi scanning run at set interval period, how this can be done, can any provide any snippets,
thanks in advance
hi expert, i did wifi scanning for android, but now i want this wifi scanning run at set interval period, how this can be done, can any provide any snippets,
thanks in advance
Use a Timer
http://developer.android.com/reference/java/util/Timer.html
Create a background service which holds the Timer, and call scheduleAtFixedRate
hi all, i found answer my question, just simple declare below before onCreate TimerTask scanTask; final Handler handler = new Handler(); Timer t = new Timer();
write below on onCreate scanTask = new TimerTask() { public void run() { handler.post(new Runnable() { public void run() { startScanning(); //here where u want to call the method } }); }}; t.schedule(scanTask, 300, 5000); // here is t.schedule( , delay, period);
thats it