如何安排我的Andr​​oid应用程序每隔一小时做一些事情 [英] How to schedule my android app to do something every hour

查看:131
本文介绍了如何安排我的Andr​​oid应用程序每隔一小时做一些事情的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的应用程序来访问数据库中的每个小时,从表中读取下一个记录然后更新desctop部件和发送通知。我知道有AlarmManager,我可以用它来注册我的意图,但是当手机关机或重新启动,他们将被删除。

I want my app to access database every hour and read next record from the table then update desctop widget and send notification. I know that there is AlarmManager which I can use to register my Intents but they are deleted when the phone is turned off or rebooted.

是否有任何其他Android级/服务,我将更新我的应用程序不断,甚至当我重新启动我的电话?

Is there any other android class/service that I would update my application continuously even when I reboot my phone?

谢谢

推荐答案

看看提供了Android SDK中的演示应用程序

take a look at the demo applications provided with android sdk

http://developer.android.com/samples/RepeatingAlarm/index.html

在看AlarmService_Service一次报警服务的实施已触发

the look at AlarmService_Service for the implementation of the service once the alarm has been triggered

这篇关于如何安排我的Andr​​oid应用程序每隔一小时做一些事情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆