Reading network activity logs on Android

2019-09-12 16:58发布

问题:

Can we read the app intra / inter net activity log on Android programmatically without having root access? If yes, can we do so for all apps on the device?

回答1:

For your application yes, it is possible, but you need to use some layer in the HTTP requests that handles the requests and logs the information.

For example using retrofit:

setLogLevel(LogLevel.FULL).setLog(new AndroidLog("YOUR_LOG_TAG"))

For all the applications in the device you need root, or install a custom proxy, for example: http://www.charlesproxy.com/ but with charles proxy you cannot do that programmatically...