geonetadmin

Smart debugging for Android and iOS applications

Blog Post created by geonetadmin on Dec 10, 2014
ArcGIS Runtime SDK for Android and for iOS allows developers to consume different kinds of awesome services from ArcGIS for Server. However, when debugging a mobile application, sometimes it is difficult to determine if the issue comes from the service or from the application. Setting up the server and making it send an HTTP response for a test can be a lot of work. But what if we can stop time and make a “fake” response?

In this blog, I’ll show how to set a breakpoint and change the HTTP response while debugging a mobile application.

First, let’s get your mobile device connected and set Fiddler as a proxy. Click here to download Fiddler. To set up an Android device with Fiddler, click here for steps on how to configure Fiddler for Android. For an Apple device, click here.

Second, we need to enable the breakpoints in Fiddler. There are two ways of doing it:
  1. Navigate to Rules > Automatic Breakpoints > After Response. It will stop at any response.
  2. In the QuickExec box (the black box at the bottom), type "bpafter yourpage.svc". Fiddler will now stop at a breakpoint before all requests to any URL containing "yourpage.svc". Type "bpafter" with no parameters to clear the breakpoint.

Next, let’s run the application. It stops in Fiddler and shows:blog11.png

Let’s look at the response.

If you don’t want to change the response, click Run to Completion. It goes to the next breakpoint or runs to the end.

What’s more, if you want to change the HTTP response, change it in 'Raw'. You can modify the content in the text box and click Run to Completion; the device gets the modified response.blog2.png

Now, you can look at your device and see the modifications!

Enjoy coding!
Rachel G. - SDK Support Analyst

Attachments

Outcomes