Inspecting Java emulator's network traffic with Fiddler
This article explains how to debug Java emulator’s network traffic using Fiddler
When coding an app that uses resources in Internet, sooner or later you run into situation where you would need to see the exact data transferred from a server to your app. Fiddler is a Web Debugging proxy which logs all HTTP and HTTPS traffic in convenient easy to follow manner. With Fiddler you can do many things, but this article concentrates on configuring Fiddler and Java Emulator.
Warning: Fiddler2 is an HTTP proxy and since it intercepts the calls, it can cause potential problems when communicating with a remote server, especially under HTTPS connections. If your application starts to behave erroneously with no apparent reason, close Fiddler2 and any connection problems should be fixed.
- To install fiddler download package from http://www.fiddler2.com/fiddler2/
After installation is completed you need to configure Connection settings. To do this start Fiddler and navigate to Tools -> Fiddler options -> Connections tab.
Check Allow Remote Computers to connect. Chain to upstream gateway proxy is needed, if you are e.g inside corporate network, which uses proxy. By default Fiddler listens to port 8888, for connections.
Configuring Java Emulator
To route connections from Java Emulator to Fiddler, proxy address must be defined in Networking settings. Navigate to Tools -> Preferences -> Networking. Usually with Fiddler it is enough to define 127.0.0.1:8888 as proxy address, but Java Emulator is a different case. You have to define your computer's actual IP address. If you don’t know the IP address, run ipconfig from command line.
Now when you initiate a connection from Java Emulator, you should see traffic in Fiddlers window.