android - How to update the markers postions on real time -


i making employee tracker in fetch employee current lat long after every 30 sec , update on server , admin module fetch lat-long of of each employee server , update eisting marker position.

so please tell me how update 100 markers position without effecting ui thread in android.

please important me.

you can update ui after every 30sec using handler.create separate method fetch , display marker on map.

use below code in activity -

    handler ui_handler = new handler();     ui_handler.postdelayed(ui_updtae_runnable, 30000); 

and below runnable method put in activity -

runnable ui_updtae_runnable = new runnable() {      @override     public void run() {         drawallmarker();//method employee location , draw on map         ui_handler.postdelayed(ui_updtae_runnable, 30000);     } }; 

hope you.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -