亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - Android后臺(tái)服務(wù)如何非root權(quán)限下獲取手機(jī)當(dāng)前狀態(tài)信息?
PHPz
PHPz 2017-04-18 10:53:43
0
2
1097

我想寫一個(gè)后臺(tái)服務(wù),每隔固定時(shí)間收集一次手機(jī)當(dāng)前狀態(tài)信息,包括內(nèi)存使用情況,CPU使用情況,以及各個(gè)進(jìn)程使用的資源占比。(看Linux進(jìn)程也可以接受)

adb工具好像只能用來(lái)開發(fā)調(diào)試,用Linux內(nèi)核的命令好像又權(quán)限不夠。所以來(lái)提問(wèn)。

先謝過(guò)各位了!


已經(jīng)找到解決方法了,如果有其他方法歡迎大家補(bǔ)充!

PHPz
PHPz

學(xué)習(xí)是最好的投資!

reply all(2)
黃舟

First of all, thank you for the first answer @didikee

Following this idea, I found an Android Process class. This class seems to obtain various process information by reading the information in the proc folder. Please go to github for details.

Another: Extended reading

PHPzhong

1.CPU frequency, CPU information: /proc/cpuinfo/proc/stat
2.內(nèi)存:/proc/meminfo
3.proc/This information file in the directory is only readable, not writable.

I took a screenshot, you can take a look for yourself: (Of course I hope you can take a look with your phone)

Reference: http://www.cnblogs.com/brainy/archive/2012/05/30/2526752.html

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template