Is there anyway to intercept HTTP request in Android?

by Cfpoon » Fri, 20 Feb 2009 13:22:16 GMT

Sponsored Links
 i am trying to look for a way, to route the network traffic (IN/OUT)
from android to my application (a proxy server, maybe..). Is there a
way to do so?


Other Threads

1. Android 2.2 problem with Digest View email of this group

Ever since upgrading my N1 to 2.2 (including the new 91 build) I've
had a problem that when I get the digest email from this group if I
click on the link it takes me to an empty browser page rather than to
the internal link for the email. Is it just me?

Yes, I know this is the developer group and not support, but since
this is the group I'm having the problem with... :-)


2. Emulator keeps slowing down after a couple of deployments/Run as Android Application in Eclipse


Do you have enough physical memory in your computer?

-- Kostya

02.07.2010 17:15, MarcoAndroid :
Small update: I even created a new 1.6 avd, but that starts up as slow as the old one. Then I finally did a reboot of my machine --> all ran fine again for a few hours. So apparently something was still running/hogging the emulator. As said, after a few hours slowness kicked in again.
Hello, More and more the Android emulator launched via Eclipse (via Run As Android Application) keeps slowing down, or the device is not found, or the user data image is in use by another emulator. I've searched and search the internets ;) but none of the solutions mentioned work (these are: delete pid file, setting ANDROID_SDK_HOME, making sure my avds are on local disk). Below I'll post a couple of my experiences trying to solve it. I couldn't solve it, but maybe somebody sees something familiair or it might help other people finding the problem. Below you see an example of suddenly the device not being found anymore. First there's a normal launch (09:54:13), then there's a second one (started 30 secs after the previous one) that just fails. I waited quite a long time (no high CPU for the emulator), then 'device not found' after about 4mins. Notice it didn't get to starting the Activity (which it did for the first run). Also notice that the Success took 4mins to appear instead of 2 seconds for the first run. So it says device not found, but the emulator is running, I can see it, it's eating cpu. Why would it not find it anymore? Could something like this be caused by my network card being gone for a split second? Or my internet connection gone for a few seconds (doubt it, it's all local right?) I didn't notice it being away, but maybe it did under water. [2010-07-01 09:54:13 - MediaControllerCode]------------------------------ [2010-07-01 09:54:13 - MediaControllerCode]Android Launch! [2010-07-01 09:54:13 - MediaControllerCode]adb is running normally. [2010-07-01 09:54:13 - MediaControllerCode]Performing com.test.code.MediaControllerCode activity launch [2010-07-01 09:54:13 - MediaControllerCode]Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'HVGAsdk1.6' [2010-07-01 09:54:13 - MediaControllerCode]Uploading MediaControllerCode.apk onto device 'emulator-5554' [2010-07-01 09:54:13 - MediaControllerCode]Installing MediaControllerCode.apk... [2010-07-01 09:54:15 - MediaControllerCode]Success! [2010-07-01 09:54:15 - MediaControllerCode]Starting activity com.test.code.MediaControllerCode on device [2010-07-01 09:54:17 - MediaControllerCode]ActivityManager: Starting: Intent { cmp=com.test.code/.MediaControllerCode } [2010-07-01 09:54:44 - MediaControllerCode]------------------------------ [2010-07-01 09:54:44 - MediaControllerCode]Android Launch! [2010-07-01 09:54:44 - MediaControllerCode]adb is running normally. [2010-07-01 09:54:44 - MediaControllerCode]Performing com.test.code.MediaControllerCode activity launch [2010-07-01 09:54:44 - MediaControllerCode]Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'HVGAsdk1.6' [2010-07-01 09:54:44 - MediaControllerCode]Uploading MediaControllerCode.apk onto device 'emulator-5554' [2010-07-01 09:54:44 - MediaControllerCode]Installing MediaControllerCode.apk... [2010-07-01 09:58:32 - MediaControllerCode]Success! [2010-07-01 09:58:32 - MediaControllerCode]Failed to upload MediaControllerCode.apk on device 'emulator-5554' [2010-07-01 09:58:32 - MediaControllerCode] device (emulator-5554) request rejected: device not found [2010-07-01 09:58:32 - MediaControllerCode]Launch canceled! And when I try it again after the above device not found problem I get: [2010-07-01 10:01:26 - MediaControllerCode]------------------------------ [2010-07-01 10:01:26 - MediaControllerCode]Android Launch! [2010-07-01 10:01:26 - MediaControllerCode]adb is running normally. [2010-07-01 10:01:26 - MediaControllerCode]Performing com.test.code.MediaControllerCode activity launch [2010-07-01 10:01:26 - MediaControllerCode]Automatic Target Mode: launching new emulator with compatible AVD 'HVGAsdk1.6' [2010-07-01 10:01:26 - MediaControllerCode]Launching a new emulator with Virtual Device 'HVGAsdk1.6' [2010-07-01 10:01:26 - Emulator]emulator: ERROR: the user data image is used by another emulator. aborting Totally weird, there's only one emulator.exe running (windows XP) and Eclipse, just like the first 2 runs. I know I can clear the locks, but that just restarts my emulator, so that's the same as exiting& starting it again. Starting the emulator outside Eclipse only works a few times, then it says again that the user data image is used by another emulator. I've tried Automatic target mode and specifying the correct avd image in the run configuration (for 1.6 and 2.1 avds). Didn't matter. I've also tried adding the -wipe-data flag at each start, but that doesn't change anything. Tip: an emulator *does* get slow when it gets full (run 'adb shell df' to see if your emulator is filling up). Then use the -wipe-data flag to clean up (note that user data gets wiped!) Is the DDMS maybe locking the emulator in some way at certain times? It definitely sometimes happens when I click the emulator in DDMS and then try to relaunch (redeploy) the same app. Also strange: when I launch another app (after exiting the emulator), it will start a new emulator but with the previous app already started! For some reason it is thinking that's still running? Or is Eclipse telling it? I did notice this: after first DDMS detecting the emulator being online, after a little bit it is just gone from the list of Devices! Something is apparently taking over the emulator or it can't be found anymore by DDMS it seems? Of course emulator.exe is still running. And sometimes after a couple of deploys the emulator just slows down terribly. CPU goes up to at least 50% (windows XP btw). Then stopping the current one and starting a new emulator might take a looong time again to start: shiny android logo showing much longer than usual, it shows No Service when it finally gets to the homescreen of the "phone", after a while it then shows Android finally. And then: Errors in console: [2010-07-01 14:49:32 - Logcat]device (emulator-5554) request rejected: device not found device (emulator-5554) request rejected: device not found at Source) at Source) at Source) at$ Source) Logcat output is empty, emulator runs at 5%. At this point (worked for about 5hrs coding, deploying, exiting emulator, waiting, starting emulator etc) the emulator just won't in any reasonable time anymore, even after multiple exits and startups of Eclipse + the emulator. It takes about 10 minutes to see the main screen, after which I get popups in the emulator saying not responding, application alarm clock not responding. After I clicked Wait for both, my app is still not showing. After exiting eclipse + emulator I did check if there's no more emulator stuff running (I only know to look for emulator.exe). And finally what I tried: turning off boot animation didn't make any change. Anybody? Regards, Marco
-- Kostya Vasilev -- WiFi Manager + pretty widget -- --

3. FroYo FR85B kok kadang suka nge-lag ya?

4. Record audio separately from both microphones on Google Nexus One

5. Emulator keeps slowing down after a couple of deployments/Run as Android Application in Eclipse

6. | Android 3.0 will appear in the fourth quarter of 2010

7. MediaController questions + problems + strange behaviour