Configure Proxy In Android x86 emulator - android

I've tried to enter a proxy into the Android x86 emulator with no success. I think the problem remains in that I don't get the authentication to enter the user/password of the dedicated prroxy (it's set up using squid).
You can find the screenshots in case you know how to fix it:
1-Before entering the proxy the Internet works with no problem.
2-Entering the proxy in the emulator.
3-After entering the proxy, Internet doesn't work.
http://postimg.org/image/fd9oqu4rx/
Thanks!

Related

Can't access localhost from Android Emulator, but on Simulator it's working

Hope anyone can help.
Why I can't access localhost (10.0.2.2) from Android Emulator, but when accessing from Simulator it's working.
I was try to edit server configuration as noticed from many tutorials, but still not working.
Here the screenshots.
Use a port number along with IP
http:// 10.0.2.2:8080
Works perfect !
or
you can use IP of your pc which you can get by typing ifconfig in terminal.
Something like
http://192.168.1.2
I have found the solution for my problem.
I try to change the port, so it working fine.
adb reverse tcp:8000 tcp:8000
And now I can access my computer localhost on Android with accessing localhost:8000.
I just got the same problem and the reason of why I could not connect to my machine was the setting of the emulator.
How to solve:
Open emulator.
Find the button with 3 dots, press it.
Go to "Settings" menu.
Disable "Use Android studio HTTP proxy settings".

Visual Studio 2015 CTP5 Android Emulator loopback to localhost?

I am using VS 2013 to connect with the new VS2015 Android Emulator. This seems to work now and I can debug, set breakpoints etc which is all fine. (Now, I would use VS2015 but it won't deploy properly -never mind).
I am also developing the server app on my machine and using Fiddler as an http debug aid.. not an uncommon situation I am sure.
The server is running (also under debug in another instance of VS 2013) using IIS Express and I have added bindings to the applicationhost.config so the IISExpress server is visible on my LAN from other PC's and I've checked it is visible.
Try as I might I can not seem to get the Emulator to send the http requests back to my computer.
My javascript uses a servicebase to hold the url:
var serviceBase = 'http://192.168.2.4:64963/'; //'http://169.254.220.177:64963/'; //'http://10.0.2.2:64963/'; //'http://localhost:64963/';
The commented ones show the ones I have tried. None of these works.. the first is the IP of my machine on the LAN, the rest are various ones I have picked up here or the Android dev site.. I have also tried:
http://mymachinename:64963
Because I am bringing both web AND API services from this URL I have also tried a chrome browser on my real android phone (over wifi on my LAN) and this can't get to my dev machine either (where my other pc's can). So I get that it probably can't resolve the names? But really not sure where to go next? I wondered about the Hosts file on my PC but not sure if I can/should set an IP address as a host name? .. any pointers? Thanks, Brett
169.254.80.80 is the localhost loopback.
By going to Additional Tools in the VS emulator for Android (click the >> button on the right hand side) and selecting the Network tab, you will get all the information about the network connectivity.
For the localhost loopback, use the address listed under the Desktop Adapter #2. Desktop Adapter #1 should work as well, which is the IP address of your machine.
I am answering this because I have seen a lot of comments/questions about this topic and need to include some bits that it is hard to fit in the comments.. and I have solved it.
First the solution.. was to delete/replace the vsemu.vhd and vsemu.sdcard.vhd for the emulator with safe copies. This was because in my efforts to fix the problem I assume I had changed some setting in the emulator phone data. Sadly I am not sure what.
However, and this checklist may be useful to someone, before this I was led to it by the fact that because I had web services as well as API from my server URL I was able to test webpage access. This worked on pcs but failed on wifi connected android devices on my network with pc names.. as mentioned in my original question. But it wouldn't work with a numeric IP address either.
I had already added the numeric IP to the applicationhosts.config file of IISExpress, but what I hadn't done, because I thought its on the machine its referring to, was execute the
netsh http add urlacl url=http://192.168.2.1:94693/ user=everyone
command to let it all through.
Once I had done this, I was able to connect using the IP address from a phone, and this led me to discover that the Emulator had obviously got some form of problem. Replacing the VHD's fixed this and I am now communicating.
In case anyone else has this issue using the following IP's worked for me:
IP of the machine
169.254.80.80
However, do remember that VS Android emulator is running in a Hyper-v VM,
So I had to punch a hole in my firewall to allow for my application port to be reached by the emulator.
If your using Web API with visual studio 2015 and VS Android emulator this link helped me out a lot
Use 10.0.2.2, This is the loopback from emulator to your host machine.
See link:
http://developer.android.com/tools/devices/emulator.html
I was having the same issue, but none of the above answers were useful for me.
My BackEnd is a PHP SlimFramework Rest Api.
I decided to change the IP in the auto start of the Slim (was localhost:7888), I tried this: php -S 192.168.43.20:7888, and everything was working fine after I configure the calls to that ip.
I hope this may help someone...
In generic the IP you must consider is the IP of the network you are using/allocated to run the android emulator.
Very raw/rude method of finding it is by going to settings (gear symbol on right panel of emulator, not the one inside) and look for ip address. . Or by opening the ADB Logging window and it's on the top left corner.
Now in command prompt type ipconfig and match the first 3 numbers of IP and that's the network your localhost loopback.
Because in many cases we will have more than one ethernets or virtualbox host only networks are running.
Happy Coding!!

Setting proxy to Android Emulator

I'm having a problem to surf internet on my Emulator, wich is targeting Google API8.I followed all the instructions I have read, setting the proxy in MobileNetworks-->APN--->....,etc, and doesn`t work. If I remove the proxy, the browser navigates locally, and if I have the proxy configured it doesn't even navigate locally.
I tested the same coonfiguration on an emulator targeting API16 and did work!!!!(local and on the Internet), so please how can I solve this.Any help will be appreciated.
PD: I tested using -dns-server x.x.x.x too and happens the same.
Emulator uses the internet connection from the host computer where it's installed.
If the host computer doesn't need any special configuration to access internet (proxy, etc.), then your emulator doesn't need it either.
Only if your computer needs a proxy configuration (or other), you will need to replicate it in the emulator.
Regards.

Android 2.1 Emulator Without Internet Connection

I have no Internet access in my Android Emulator.
The app I am developing needs Internet connection, but the Android Emulator have no internet connection. I also tried to use the native browser of the emulator, but it also does not work.
When I export my app to a real android, it works just fine.
I already tried to press F8 to turn on and off the "3G connection" in the emulator.
I already turned off the Windows Firewall, but it didn't work.
Data:
Windows 7 x64
Eclipse Plugin for Android
Android version 2.1
Try recreating the emulator instance. Sometimes the instances get corrupted and you get weird behavior like the one described by you above. The internet connection should work without any interaction in a fresh emulator instance.
If you are behind a firewall or you are using a proxy then things can get a bit more complicated but there are workarounds for those situations also.
Don't keep re-creating new instances of the same emulator. I had this problem before and created a brand new emulator (same settings as the other one), and it worked fine for some reason.
I had to set manually the DNS Server of my emulator.
To do that:
Within Eclipse I went to Run Configurations -> Target and added "-dns-server X.X.X.X" and everything worked fine afterwards. (obviously X.X.X.X was the IP address for my DNS server).
so i put this line: -debug-slirp -dns-server 192.168.178.1

emulator throwing hostunresolved exception in android?

i have as my first activity in my application a request to a certain address, from where i get XML and then i parse it...
I have added the permission on for internet access in my android.manifest file.
my problem
whenever i run my application on my emulator the following exception is thrown:
05-19 18:25:05.099: WARN/System.err(473): java.net.UnknownHostException: Host is unresolved: www.svgverlag.de:80
i don't understand what is going wrong.
when i open the same address in my browser it opens up fine
i have tried restarting the emulator several times.
i am using a mac.
thank you in advance.
EDIT:
i have tried creating several emulators and in all of them this is happening.Also i tried on my friends macbook pro, and the same thing is happening.
Also in the emulator's browser no webpage is opening.For some reason the emulator is not able to access the internet.
UPDATE
I believe that there is a problem with the emulator on mac per se. No matter what i try:
set the dns in Eclipse Preferences using dns-server- 8.8.8.8
turn of my firewall
nothing seems to make a difference and my emulator is not able to access the internet.
Also there is a 3G symbol at the top of my emulator but with no help regarding internet access.
While on a my windows machine, things seem to work fine without any settings from my side.
what do i do?
Can you try using the IP address of this website instead of using its host name?

Categories

Resources