c# - How to write a thread for call a method periodically in windows phone 8? -
this question has reply here:
how run periodic tasks every 5 minutes or more in windows phone 8 3 answersi have phone call method every 5 minutes. seek background agents take 15 - 30 minutes in production mode. want task within 5 minutes. how task using threads? how assign thread background thread? how process when current app not running also?
use system.threading.timer
.
timer timer = new timer(mymethod, state: null, duetime: 0, period: 5*60*1000);
a timer queue method executed threadpool
every x milliseconds. also, create sure maintain strong reference timer maintain beingness garbage collected.
to run method when app not running, have utilize background agents. there's no way bypass 15 minutes restriction.
c# multithreading windows-phone-8
No comments:
Post a Comment