How to execute Linux command on Android/Java with low priority?

本小妞迷上赌 提交于 2020-01-15 09:09:29

问题


as the title already says, I want to execute a linux comand with a very low priority so as to not disturb my app and keep it running smooth.

I currently use:

Runtime.getRuntime().exec

Is there another way to achieve this with setting the priority ?


回答1:


You can change the process priority on rooted devices with renice provided by the Busybox binary if you know the PID of the process you want to give less priority to.

Just run the command using the exec function of Runtime just like you are.



来源:https://stackoverflow.com/questions/9790069/how-to-execute-linux-command-on-android-java-with-low-priority

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!