语音识别服务是否停止在奥利奥工作?

问题描述 投票:-2回答:1

我在我的应用程序中实现了后台服务语音识别。由于Oreo OS不支持后台服务,它会在几秒钟后停止工作(在Pixcel和Nexus设备中)。此服务是应用程序的主要功能。它应该继续在Android OS 8中运行。请给我一个解决方案。

此链接将解释Oreo 8 android os:https://developer.android.com/about/versions/oreo/background.html#migration中的背景服务限制

android android-service speech-recognition speech-to-text android-8.0-oreo
1个回答
0
投票

你可以查看这篇文章:Keep those background Services working when targeting Android Oreo

“JobIntentService的工作方式与服务相同,但它将工作排入兼容的Android目标上的JobScheduler。这意味着您可以轻松地将服务和IntentServices转换为JobIntentService并保持相同的功能。”

它将自动处理旧的Android版本兼容性:Here

“在Android O或更高版本上运行时,工作将通过JobScheduler.enqueue作为作业分派。在旧版本的平台上运行时,它将使用Context.startService。”

© www.soinside.com 2019 - 2024. All rights reserved.