0
votes

Debug in Xamarin Visual Studio

How to debug the android application in Visual Studio Xamarin to see the response from web api? I am using Xamarin Visual Studio, ad making some http web api calls. the application is showing some random value which is not exactly the expected response from web api. In android studio it is possible to debug and figure out where the problem is. my question is, can we as well debug in Xamarin Visual studio. because when I put the debugger points the application doesn't just stop at the debugger, and I can not figure what exactly the problem is.

1
Are you using a Debug compilation? Also, the debugger has sometimes problems with breakpoints and webviews on Android 5/6, try to debug in a 4.2 device. Bug info: bugzilla.xamarin.com/show_bug.cgi?id=29365#c4Gusman

1 Answers

0
votes

I would recommend installing Fiddler. Once you have that installed, fire it up and configure it to proxy as per the default configuration.

Then in your Android device or emulator configure the Wi-Fi to point at Fiddler on port 8888.

Once you have done this you will be able to see all the requests and responses in the Fiddler UI. The steps to perform this on the device or emulator are:

  • Swipe down from the top of the screen and tap the Settings icon.
  • Tap Wi-Fi.
  • Tap and hold your current Wi-Fi network. Select Modify Network
  • Tap the Show advanced options box.
  • Tap the Proxy settings dropdown and select Manual.
  • Type the IP address and port (usually 8888) of the Fiddler server.
  • Tap Save.

To verify this configuration, go to http://ipv4.fiddler:8888/. You should see the Fiddler Echo Service webpage, and the traffic should appear in Fiddler.