Android: Send Longitude ans Latitiude after 60 seconds to the localhost server(WAMP) -


i want send longitude, latitude, timestamp , stonest wifi access point json format server (wamp- localhost) after every 60 seconds best approach that? use asynctask asynctasks should ideally used short operations (a few seconds @ most.) can give short example sending data approach asynctask?

i appreciate help.

start these tutorials http://www.tutorialspoint.com/android/android_php_mysql.htm http://www.tutorialspoint.com/android/android_php_mysql.htm

after here how repeate every 60 seconds

    boolean run=true;     handler mhandler = new handler();//sorry forgot add ... ...       public void timer() {             new thread(new runnable() {             @override             public void run() {                 while (run) {                     try {                         thread.sleep(60000);//60000 milliseconds  60 seconds                         mhandler.post(new runnable() {                              @override                             public void run() {                                  //here send data server                             }                         });                     } catch (exception e) {                     }                 }             }         }).start();} 

call start it

  timer() 

and stop

run=false; 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -