Fiddler is the most useful option. On @Scythe emulator the answer will work, but on a real device you will need to install a proxy server in Apache Http Client. The following code will do this:
HttpHost proxy = new HttpHost("youripaddr", 8888); params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
If you use https, fiddler is not so useful. In this case, you can enable build support in the Apache Http Client. The following code does this:
Headers only:
java.util.logging.Logger apacheHeaderLog = java.util.logging.Logger.getLogger("org.apache.http.headers"); apacheHeaderLog.setLevel(java.util.logging.Level.FINEST);
Headers and wire:
java.util.logging.Logger apacheWireLog = java.util.logging.Logger.getLogger("org.apache.http.wire"); apacheWireLog.setLevel(java.util.logging.Level.FINEST);
Please note that for this you will need to configure java.util.logging Handler at the highest level, and the default handler is configured to write to the logcat log, which by default will filter DEBUG entries (the best).
source share