Step by Step with the SAP Cloud Platform SDK for Android
Part 11 — Using Fiddler to Trace Client Network Requests
Fiddler can be used to track requests made by the app to the server, allowing the user to have an easier time debugging application requests and seeing both the app’s requests and the server’s responses.
- In Fiddler, select Tools > Options.
- Under the Connections tab, ensure that the “Allow remote computers to connect” checkbox is checked.
- Uncheck “Act as system proxy on startup” so that Fiddler only captures traffic that is specifically proxied through it.
- Restart Fiddler.
In this step, we will setup the device to route its Wi-Fi connection through Fiddler.
- Go to the Wi-Fi window, which is under Settings > Wi-Fi.
- Modify your current Wi-Fi network and open “Advanced options”
- Set “Proxy” to “Manual” and set the “Proxy hostname” and “Proxy port” so that all the device’s network requests will be sent through fiddler.
“Proxy hostname” should be set to the IP address of the computer that is running Fiddler. It can be found by running the command ipconfig from a command prompt.
“Proxy port” can be found under Options > Connections > Fiddler listens on port (default is 8888).
- Save and go to http://ipv4.fiddler:8888/
- Click on “FiddlerRoot certificate” to download the certificate.
- Name the certificate (ie. Fiddler) and tap OK.
See Documentation for more details.
In this step, we will allow Step by Step app to allow certificates added by users.
- Create a new xml file named “network_security_config” under the res/xml folder
- Replace the contents of the newly created network_security_config.xml file with the following:
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config> <trust-anchors> <certificates src="system" /> <certificates src="user" /> </trust-anchors> </base-config> </network-security-config>
- In the AndroidManifest.xml file, under the application section add the below line.
Now you should be able to see the requests made by the app to the server, such as the OData call seen below.