• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

App/Service to perform task every minute

cpper

Newbie
Aug 29, 2013
11
2
Hi there :)

I want to build a small app for my Android 6.0 Galaxy S5 which downloads a webpage every minute, checks its source code, and if a particular string is found at a particular line number, fires a notification. The program should run in the background, and should not exit unless it's requested to. It would be great if it could survive the "End all apps" command from "Active applications" tab.

From what I've read, I would need to build a Service in order to achieve such thing. A straight forward method to do this would be to extend the Service class and to add the code for downloading the page, and do something like (the android version of) sleep(1m) in a loop. But I'm pretty sure there are better ways to achieve this.

Could you tell me please which classes I need to use(extend) to accomplish what I wish ?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones