• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Proxy settings for Emulator

 
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://<machineName>:<port>;

Or

http://<username>:<password>@<machineName>:<port>;

How to use this ?
 
Author
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://d.android.com/guide/developing/tools/emulator.html#proxy
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[I am not sure if I recall this correctly...try this if you want to]

There is a com.android.providers.settings folder on the emulator(inside data/data/) which has a database named settings.db.In this database, there is a table called "system". You can insert a row in this table which contains details of your proxy.

I think I was able to connect to internet from the browser of my emulator after this..




 
Ed Burnette
Author
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You used to have to make the database change but in current versions the option seems to be sufficient.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can follow these steps to set up proxy for emulator:

1. Connect to the emulator using the "adb shell" command (From "tools" folder of SDK)
adb shell
enter this..
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite> INSERT INTO system VALUES(99,'http_proxy','<PROXY_IP>:<PROXY_Port>');


2. Use the below command to check if the value is inserted
sqlite> SELECT * FROM system;

3. Restart the emulator and check for the browser to work.

4. An alternate if this doesnt work is, Go to Run -> Run Configurations ->Target in eclipse and enter
-http-proxy <PROXY_IP>:<PROXY_Port> in Additional emulator command line options.

 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ed Burnette wrote:You used to have to make the database change but in current versions the option seems to be sufficient.


I concur with you, Sir. Lately, I have been using the command line switch(-http -proxy) to start the emulator instances(but I think the row in the system table is still there unless I have chosen to "wipe data").

I wonder what all can be set for emulator by making an entry in system table. What is the domain set of settings!?
Is using the system table deprecated?

Thanks.
 
Ed Burnette
Author
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using the system table is definitely not the recommended way to do things, and it's undocumented and subject to change with each release. That said, there are probably some interesting things in there if you find yourself bored one afternoon. Personally I'd rather take the time to read the source. Or to keep up with Android forums.
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic