每月一次在我的应用程序中运行任务 [英] Run a task in my app once in every month
问题描述
在我的android应用程序中,我创建了一个更新SQLite数据库中某些字段的函数,现在我手动运行此函数,并且可以正常工作,但是我想每月一次自动运行此函数.怎么可能.
In my android app I have created a function that updates some fields in SQLite database, now I run this function manually and it is doing the job, but I want to run this function automatically once in a month. How it is possible.
推荐答案
要定期运行任务,我建议您看一下JobScheduler api,它是最新且功能更强大的计划工作,请看一下此 https://developer.android.com/reference/android/app/job/JobScheduler.html 如果您的应用面向api> 21,则必须使用Jobscheduler,如果您想支持较低版本,请查看Firebase Job Dispatcher: https://github.com/firebase/firebase-jobdispatcher-android
To run your task periodically i recommend you to take a look at it JobScheduler api which is latest and more powerful for scheduling the job take a look at this https://developer.android.com/reference/android/app/job/JobScheduler.html if your app targets api >21 you must use jobscheduler if u want to support the lower version take a look at firebase job dispatcher:https://github.com/firebase/firebase-jobdispatcher-android
这篇关于每月一次在我的应用程序中运行任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!