Is there a simple way to monitor network traffic with in Android Studio? I am looking for an equivalent of Firefox or Chrome's console where you can see REST HTTP calls: requests, responses and headers. I have tried the ADM (Android Device Monitor) and the "Network Statistics" but I don't see the detail of my HTTP calls.
From the Android Studio navigation bar, select View > Tool Windows > App Inspection. After the app inspection window automatically connects to an app process, select Network Inspector from the tabs.
To open any Profiler, click anywhere on its respective row, where you'll see a more detailed view. Note: For Android Studio versions 2020.3. 1+, Network Profiler has been moved to App Inspector. To open the Network Profiler, go to View > Tool Windows > App Inspection and select Network Inspector from the tabs.
The Android Profiler in Android Studio 3.0 and higher replaces the Android Monitor tools. The Android Profiler tools provide real-time data to help you to understand how your app uses CPU, memory, network, and battery resources.
According to the Android Official, it only works for the app using HttpURLConnection and OKHttp libraries. If you are using other network library or the legacy apache HttpClient. It is not available to capture the network traffic.
Network connection troubleshooting If the Network Profiler detects traffic values, but cannot identify any supported network requests, you will receive the following error message:
"Network Profiling Data Unavailable: There is no information for the network traffic you've selected."
Currently, the Network Profiler supports only the HttpURLConnection and OkHttp libraries for network connections. If your app uses another network connection library, you may not be able to view your network activity in the Network Profiler. If you have received this error message, but your app does use HttpURLConnection or OkHttp, please report a bug, or search the issue tracker to include your feedback in an existing report that's related to your issue. You can also use these resources to request support for additional libraries.
Try Stetho from Facebook http://facebook.github.io/stetho/
Network Inspection
Network inspection is possible with the full spectrum of Chrome Developer Tools features, including image preview, JSON response helpers, and even exporting traces to the HAR format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With