Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Firebase作业调度器是否使用作业调度器?_Android_Android Jobscheduler_Firebase Job Dispatcher - Fatal编程技术网

Android Firebase作业调度器是否使用作业调度器?

Android Firebase作业调度器是否使用作业调度器?,android,android-jobscheduler,firebase-job-dispatcher,Android,Android Jobscheduler,Firebase Job Dispatcher,由于我的应用程序必须适用于Android版本4.x,因此我不能仅依靠JobScheduler进行后台活动。Firebase JobDispatcher与我需要的版本向后兼容,所以我对它进行了一些测试 我的期望是,在Android上使用Google Play服务时,我在Android 7.1.1上获得控制台输出…不会太少: adb shell dumpsys jobscheduler | grep x\ active 在过去的SDK版本上,dumpsys jobscheduler可能无法转储不存

由于我的应用程序必须适用于Android版本4.x,因此我不能仅依靠JobScheduler进行后台活动。Firebase JobDispatcher与我需要的版本向后兼容,所以我对它进行了一些测试


我的期望是,在Android上使用Google Play服务时,我在Android 7.1.1上获得控制台输出…不会太少:

adb shell dumpsys jobscheduler | grep x\ active
在过去的SDK版本上,dumpsys jobscheduler可能无法转储不存在的内容(启动此类SDK版本,然后发出命令将显示,因为当它工作时)

自Android 7.0.0以来,有一个新的命令用于
作业调度器

adb shell cmd jobscheduler help

Job scheduler (jobscheduler) commands:
  help
    Print this help text.
  run [-f | --force] [-u | --user USER_ID] PACKAGE JOB_ID
    Trigger immediate execution of a specific scheduled job.
    Options:
      -f or --force: run the job even if technical constraints such as connectivity are not currently met
      -u or --user: specify which users job is to be run; the default is the primary or system user
作业调度程序和作业调度程序是两个完全不同的东西;调度程序已经是向后兼容的驱动程序(因此不能期望操作系统有调度程序)

请参阅,或者这可以进一步解释


一般来说,这个库也有同样的功能。

谷歌有望提供一个JobScheduler驱动程序:谢谢你的回答。“我在shell中看不到任何活动”是指我的应用程序。如果没有合适的作业调度器驱动程序,作业调度器现在就毫无用处。我自己为它构建了一个基本的调度程序驱动程序,但我还是感到失望。GitHub项目上几乎没有任何活动,承诺的功能也没有。事后看来,我应该使用Evernote Android作业库。