[Solved] [Emulator] Proxy problem

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

[Solved] [Emulator] Proxy problem

Postby Syl » Wed Oct 21, 2009 11:48 am

I have a network problem with my Android Emulator when I'm in my company office.

My DNS server and my proxy server is the same machine : 192.168.4.3

I launch my emulator with the following command to display network debug messages and to configure proxy and DNS servers :
Code: Select all
emulator -debug-proxy -debug-slirp -avd AVD_1.6_SDcard_64M -dns-server 192.168.4.3 -http-proxy http://192.168.4.3:3128


And I get the following messages in console when I try to connect to http://www.google.com from the web browser :
Code: Select all
### WARNING: can't resolve DNS server name '192.168.4.3'
### WARNING: will use system default DNS server
emulator: DNS Servers:
emulator:   192.168.4.3
emulator: sending slirp logs with mask 7 to C:DOCUME~1sguyomarLOCALS~1Temp\
AndroidEmulatorslirp.log
proxy_http_setup: creating http proxy service connecting to: 192.168.4.3:3128
server name '192.168.4.3' resolved to 192.168.4.3:3128
proxy_http_setup: creating HTTP Proxy Service Footer is (len=2):
'
'
http_service_connect: trying to connect to 209.85.229.105:80
http_service_connect: using HTTP rewriter
tcp:209.85.229.105:80(1488): cannot connect to proxy: <unknown error>


Althought there are "###WARNING" messages about the DNS at the beginning, DNS resolution works because http://www.google.com was replaced by its IP address 209.85.229.105.


I also try to enter http_proxy inside the database but it does not work...
Code: Select all
adb shell

sqlite3 /data/data/com.android.providers.settings/databases/settings.db

INSERT INTO system VALUES(99,'http_proxy','192.168.4.3:3128');


Does anyone know how to solve this network problem ?
I want to solve it, not only for the web browser, but for all applications because I will develop applications that need to access network.

Thanks for you help ! :)
Syl
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Oct 21, 2009 11:03 am

Top

Postby Syl » Wed Oct 21, 2009 2:58 pm

Solution herein :

Settings > Wireless controls > Mobile networks > Access Point Name

Create a new APN with parameter :
Proxy : 192.168.4.3
Port : 3128

No need to make a database insertion or use command line options when launching the emulator.
Syl
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Oct 21, 2009 11:03 am

Re: [Solved] [Emulator] Proxy problem

Postby roysamuel » Wed May 19, 2010 6:50 am

hi,
try using :

Code: Select all
$ emulator -avd MY_EMULATOR -http-proxy http://10.255.11.11:8080 -verbose -wipe-data


Replace the emulator name 'MY_EMULATOR' and the proxy value with values applicable to you.
This works for me on my Mac machine...i.e., I can access the internet from the emulator's browser. 8)
However, the same setting on my windows setup, does not give me internet access on the emulator. :shock:
Truth Liberates <>< <>< <><
Roy Samuel.
User avatar
roysamuel
Freshman
Freshman
 
Posts: 6
Joined: Tue Apr 20, 2010 8:20 am

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Google [Bot] and 2 guests