Help, access to localhost from Buildroid virtual device

NwCaos

Member
Hi everybody nice forum, ...I'm trying acces to my ASP.Net deploy server with HttpUtils but don't find the page (error timeout).

I'm trying with 10.0.2.2:1234, localhost:1234 and 192.168.0.1:1234
(1234 is my website local port)
(192.168.0.1 is my local ip)

the app work fine in 10.0.2.2:1234 in android avd, but in the Buildroid virtual device can not find

Please I need a tip ...thank's! :sign0085:
 
Last edited:

BarrySumpter

Active Member
Licensed User
Longtime User
Localhost is ipaddress 127.0.0.1
Both of these will point to the current device only.

On your web server host PC
use either Localhost or 127.0.0.1 in your web browser address
you should get your default web server page.

If you don't then you haven't set it up correctly.
Or you've deliberately restricted your web server from LocalHost.

Once you do get your default web server page
comming up on your web server pc,
you'll need to find your web server host pcs ipAddress.

Then you'll need to find your phone or your emulators ipAddress.

They will need to be on the same domain (DNS).

I find static ipAddress to be much faster.


My router is on: 192.168.1.1

My web server PC (and main devlopment pc) is on: 192.168.1.2
Gateway: 192.168.1.1
DNS is: 192.168.1.2

And my phones are on 192.168.1.3 etc2
Gateway: 192.168.1.1
All DNS are: 192.168.1.2

You can't use LocalHost or 127.0.0.1 on
any other device than the web server pc.

if you use 192.168.1.2 in any browser on any of these devices
you should get your web server default page.

Let me know how you go.
 
Upvote 0

BarrySumpter

Active Member
Licensed User
Longtime User
I found that the Build Droid ipAddress was empty on first execution.
I don't know why.
And could't get the wifi advanced dialog to allow me to change to a static address.
And once displayed was different than the actual virtual device ipAddress.

I wrote this trying to chase it down.

hth
 

Attachments

  • ipAddress.zip
    5.6 KB · Views: 223
Last edited:
Upvote 0

NwCaos

Member
Trying

thank you very much everyone, I was trying first with several directions:
127.0.0.1 (refused)
192.168.1.10 (refused)
10.0.3.15 (refused)
10.0.2.2 (refused)
192.168.1.102 (refused)
192.168.56.1 (refused)
192.168.56.102 (refused)
192.168.56.101 (refused) this appears in the "buidroid vm configuration" and the IpAddress app, thanks a lot Barry Sumpter ... you're very good programmer and you help was very fast.

My web server PC (and main devlopment pc) is on: 192.168.1.10 (fixed local ip)
Gateway: 192.168.1.254
DNS is: 192.168.1.254
buildroid vm: 192.168.56.101 (in my work and my home always is the same)
Ethernet VirtualBox Host-only is: 192.168.56.1 (always is the same)
and has access to internet

I also change the settings of the Ethernet VirtualBox but the android ADB not recognized from b4a (I run the updated script)

.....thank you too Toley but I want to access from the phone to the PC, not in backwards. or where you say, sorry I don't speak fine english.

Greetings, I will keep trying.
 
Upvote 0

BarrySumpter

Active Member
Licensed User
Longtime User
Is the server actaully connecting and sending back a "Refused" message?
Or is the exact message something else?
Like "Commection has timed out"

On the emulator
settings | wifi | F1 (advanced menu) | click advanced menu item

Whats the IP Address?
Make sure its not conflicting with another device.


On the web server Host PC
Localhost
127.0.0.1
192.168.1.10
All of these should give you the default web page.
If not, there is something wrong.
Or it might need the :1234 port designation
If it needs the :1234 port - you'll need to use the port on all your tests

On another PC connected to the same domain:
192.168.1.10
Same as directly above.
If this doesn't work you may have the web server secured against these attempts.

Do you have access to this web server from the inTERnet?
Something like:
BarrySumpter.Com
If so you could try that on your emulator.


hth
 
Last edited:
Upvote 0

NwCaos

Member
Thank's again BarrySumpter, sorry but I spent a few days out of the office and I later to check it.

in the control panel I changed the IP address of my VirtualBox Host-Only Network and this is wrong.

I tried to change my settings as yo explain to me, was when I discovered that the Oracle VM Manager >> preferences >> network ... was the option to change the DHCP server and Voala!!!!

all is working, thank's a lot :icon_clap::icon_clap::icon_clap::icon_clap:
 
Upvote 0
Top