[ Web Proxy ]
URL:
Viewing: https://developer.android.com/studio/debug/network-profiler [Back]  [Original]

Inspect network traffic with the Network Inspector  |  Android Studio  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]

Inspect network traffic with the Network Inspector Stay organized with collections Save and categorize content based on your preferences.

The Network Inspector displays real-time network activity on a timeline, showing data sent and received. The Network Inspector lets you examine how and when your app transfers data and optimize the underlying code appropriately.

To open the Network Inspector, follow these steps:

  1. 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.
    • If the app inspection window doesn't connect to an app process automatically, you may need to select an app process manually.
  2. Select the device and app process you want to inspect from the App Inspection window.

Network Inspector overview

At the top of the Network Inspector window, you can see the event timeline. Click and drag to select a portion of the timeline and inspect the traffic.

The Network Inspector window [The Network Inspector window] Figure 1. The Network Inspector window.

In the details pane, the timing graph can help you identify where performance issues could be occurring. The start of the yellow section corresponds to the first byte of the request being sent. The start of the blue section corresponds to the first byte of the response being received. The end of the blue section corresponds to the final byte of the response being received.

In the pane below the timeline, select one of the following tabs for more detail about the network activity during the selected portion of the timeline:

From either the Connection View or Thread View, click a request name to inspect detailed information about the data sent or received. Click the tabs to view the response header and body, request header and body, or call stack.

On the Response and Request tabs, click the View Parsed link to display formatted text. Click the View Source link to display raw text.

Toggle between raw text and formatted text [Toggle between raw text and formatted text] Figure 4. Toggle between raw text and formatted text by clicking the corresponding link.

In addition to showing network requests for HttpsURLConnection, Network Inspector also supports OkHttp. Some third-party network libraries, such as Retrofit, use OkHttp internally, so Network Inspector lets you inspect their network activity. The Now In Android sample app uses OkHttp for its network operations and is a good place to see it in action.

If you are using the HttpsURLConnection API, you only see headers in the Request tab that you include in your code using the setRequestProperty method, as shown in the following sample:

Kotlin

val url = URL(MY_URL_EN)
val urlConnection: HttpsURLConnection = url.openConnection() as HttpsURLConnection
...
// Sets acceptable encodings in the request header.
urlConnection.setRequestProperty("Accept-Encoding", "identity")

Java

URL url = new URL(MY_URL_EN);
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
//...
// Sets acceptable encodings in the request header.
urlConnection.setRequestProperty("Accept-Encoding", "identity");

Troubleshoot network connection

If the Network Inspector detects traffic values but can't identify any supported network requests, you receive the following error message:

**Network Inspector Data Unavailable:** There is no information for the
  network traffic you've selected.

Currently, the Network Inspector supports only the HttpsURLConnection and OkHttp libraries for network connections. If your app uses another network connection library, you might not be able to view your network activity in the Network Inspector. If you have received this error message but your app does use HttpsURLConnection or OkHttp, report a bug or search the issue tracker to include your feedback in an existing report related to your issue. You can also use these resources to request support for additional libraries.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-03-06 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-06 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page