Developing with Android behind a http proxy
I wanted to create a small android app that made REST requests and then showed the output. I wrote the code and tried running the AVD. In the debugger I saw the http request run but it acted like it was timing out. I quickly realized that I needed two things.
- I needed to add INTERNET access to the AndroidManifest.xml.
- I needed to make my Android Virtual Device (AVD) know that it was behind a proxy.
Sites I used for help
- Updating the AndroidManifest.xml file
http://developer.android.com/reference/android/Manifest.permission.html#INTERNET - Setting the AVD proxy settings
http://developer.android.com/guide/developing/tools/emulator.html#startup-options
Updating the AndroidManifest.xml file
- Open the AndroidManifest.xml file in Eclipse
- Click on the Permissions tab at the bottom
- Click the “Add” button => choose Uses Permission => Click “OK”
- Type “android.permission.INTERNET” in the textbox and then click on the “Uses Permission” item on the left. You will see your new permission has been added.

Setting up the HTTP proxy for your AVD
- In Eclipse, click Run on the menu and choose Run Configurations
- Click the Target tab, find the Additional Emulator Command Line Options textbox and put in your proxy. An example would be –http-proxy http://myproxyaddress.com:8080. The colon and port number at the end are optional.
- Click Apply and then Close.