Android: AsyncTask with AlarmManager and Service

后端 未结 3 911
清酒与你
清酒与你 2021-01-23 18:55

I want to post JSON string with HttpURLConnection api to the localhost server(WAMP) periodically every 60 seconds to be inserted in the database. Therefore, I am executing MyAs

3条回答
  •  离开以前
    2021-01-23 19:43

    Personally, i would use the alarm manager. That's what its for.

    It is none of my business, but you should keep in mind that a request over the internet once every minute will drain your battery.

提交回复
热议问题