We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现在开启自动埋点$AppEnd后,每2s会往SharedPrefence里面更新一下数据,调用比较频繁,SharedPrefence的ANR较多,能否优化一下,不使用SharedPrefence,使用其他的数据存储方式,比如数据库?
$AppEnd
SharedPrefence
The text was updated successfully, but these errors were encountered:
@William353 感谢你的反馈,你这边使用的是哪个版本的 SDK?目前我们从 4.4.4 版本,已经将这部分操作放到异步线程处理了。
Sorry, something went wrong.
4.4.9
其实不管是否在子线程,只要用SharedPrefence,就会有ANR风险。 Android 8.0以上系统,会把写任务先放到QueuedWork的任务队列再取出执行,QueuedWork.waitToFinsih 时,如果任务队里有尚未处理的写任务,主线程会主动执行,这就是anr的原因。 所以只要用SharedPrefence,就一定会有anr出现的概率。是否考虑其他存储方式?
@William353 谢谢反馈,这块我们内部调研一下
No branches or pull requests
现在开启自动埋点
$AppEnd
后,每2s会往SharedPrefence
里面更新一下数据,调用比较频繁,SharedPrefence
的ANR较多,能否优化一下,不使用SharedPrefence
,使用其他的数据存储方式,比如数据库?The text was updated successfully, but these errors were encountered: