GBG Developers

Guides   |   Debugging with the Android Studio Network Profiler

Debugging with the Android Studio Network Profiler

This guide explains how to quickly troubleshoot authorisation or SDK services when developing applications. 

The SDK provides a fast, high-level way of using the Identity Solution but the underlying communication is HTTP based. If during application development you wish to see what the underlying HTTP activity contains, it is possible to achieve this using the Profiler tool in Android Studio. It can be useful when initially troubleshooting connectivity, communication or service issues during software development.

To use the Profiler, click on the Profile button on the toolbar shown in the screenshot below. As the app runs in the emulator, the Android Studio window will show network activity on a chart (highlighted below). For more information refer to the Network Profiler documentation in the Android Studio user guide.

In this example screenshot, the leftmost cluster of activity relates to when the application was started and a HTTP request was sent to the identity provider for an identity provider access token. The activity near the centre of the window occurred when the SDK’s AuthService authenticate method was called and the GBG Identity Solution server returned a GBG access token. The activity close to the right of the window occurred when the SDK’s VerifyPeopleService was used.



Click in the network chart area, and it will expand to fill the window. Drag across the chart to select the area of interest and the HTTP transactions will list under the chart. From there you can double-click on a transaction and then navigate through Overview, Response and Request panes on the right side. In the example screenshot below, it can be seen that the AuthService resulted in an access token being returned. If there is a failure, the request and response can be examined. The request in this example would have contained the identity provider access token that was sent to the GBG Identity Solution.

Click on the back arrow (shown at the top-left of the screenshot) to navigate back.