I have seen this question
I am creating a flutter app and restful API with Laravel.
it is work on AVD with url = "10.0.2.2:8000".
and my browsers on computer url = "localhost:8000".
I turned off the firewall on windows 10.
I can access to Xampp dashboard from my phone's browser "192.168.1.8:80" , but it doesn't work with port 8000
My computer Ip
Xampp server
Try this:
php artisan serve --host 0.0.0.0 --port 80
Just make sure that the port is free.
Reference: https://stackoverflow.com/a/30675683/5192105
php artisan serve --host=you ip address
Related
My test server is iis express, so I can access only localhost:port.
But android emulator's localhost hostname is 10.0.2.2, it occur Bad Request error.
I want change 10.0.2.2 hostname to localhost.
Is it possible? How Can I change it?
Android emulator runs in a Virtual Machine and using 10.0.2.2 or 127.0.0.1 or localhost will point to the emulator's own loopback address.
Therefore localhost will not work as a base URL - instead of changing the name you could upgrade to the Url to http://10.0.2.2:8080.
For more info on this you can have a look at this Medium Post. There is also this question on SO which also addresses the same issue.
android studio, how connect to sql server withpout a server ip sample http:\myhomepage:1433
i dont waht to connect use an ip sample:
111.111.1.111:1433
To connect to your localhost server, you should be connected to the same network (Phone and the Computer with the server), just open cmd and type ipconfig and get the ip address for the server. in your android connection string enter http://ipaddress/projectfolder
You can only connect using the domain name http://example.com for a hosted live website since mobile devices won't recognize your localhost
I'm developing an Android app that must connect to the server to retrieve some data. I've 2 devices connected on my local WIFI via a router: My development laptop (as server) and my development android phone (as client). The laptop has as IP address 192.168.41.50 and my Apache HTTP server is running on port 81.
My problem is the following:
If I run my android application to retrieve data into the server, it doesn't work, it's giving me a timeout exception:
D/OkHttp: <-- HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /192.168.43.50 (port 81) after 120000ms
But the same address is working on the laptop's browser
How can I solve this problem.
Have a look at the firewall.
Switch it off for a test.
Your problem solution is simple ->
You have to allow external devices to connect your server.
If you are using Wamp Server then look at this post for your answer ->
How to enable local network users to access my WAMP sites?
If you are using Xampp Server then look at this post for your answer ->
Accessing localhost (xampp) from another computer over LAN network - how to?
Hope this solve your problem.
i have an app(ruby on rails) running great on my desktop(localhost) which can recognize a request from a browser/mobile phone.Can i check it on my mobile phone too,without using android emulator.Just by hitting my ip will help me out????
rails s is by default binding to all interfaces on your desktop.
So if you know the IP address of your desktop (look it up in ifconfig) you can simply use that IP to access the Rails application.
eg: http://192.168.0.100:3000.
You then inspect the user-agent to find out it's a mobile phone or not.
The rails server can be started with the b flag which specifies the IP address you want to use:
rails s -b 0.0.0.0
deploy your app to heroku or AWS and use git to maintain your app code...Then you can connect to your phone using internet
I am developing an android application, in which I have to upload image to a local host, I have created a database, also put the php file,,,,,
I did r&d.and tried the way in this url
uploading files in android using emulator and localsystem
But did not get success..... My localhost url is http://localhost/connect1.php
Can anyone guide me how to upload image to a local host?
The URL http://localhost is only valid on your computer. For Android to find the server, it will need a real url.
For development, if you don't have an official URL yet, you can put your phone on your local wireless network and use the IP address of your local webserver. To get the ip address run ipconfig (windows) or ifconfig (linux). So your url will be something like http://10.23.234.12/connect1.php