Can't access local server url (my-computer.local) on android tablet - android

I have configured a local URL on my mac (http://my-computer.local) to access a server I host on my mac, on a local WIFI network (offline).
I can access my server with this URL using other desktop computers and iPhones, but not on Android devices.
On the Chrome browser of my android tablets/phone I get the page:
You are Offline
ERR_NAME_NOT_RESOLVED
However, when I type the server's IP address directly in the same browser on the Android tablet, it works.
Why is the local URL not working only on the Android device and how can I solve this, and get it to work?

Related

How to access url with hostname on laptop from android mobile app

We have mobile apps installed on Android mobiles and ASP.NET Core web API application deployed on IIS server on Windows 10 Laptop / PC.
my Android phones and laptop are connected to the same WiFi network created with Mobile Hotspot on Laptop, we can reach the IP address from mobile and also able to call web api. (Note: we are not using Wifi Routers)
Scenario 1: Working scenario
Web API deployed with default settings and if access with laptop ip address we are able to hit api successfully.
But due to dynamic nature of the ip address on laptop we have to change ip address every time in mobile app. We would like to avoid this situation by using hostname.
Setting static ip address on laptop is also not solution for us. So we have planned following scenario.
Scenario 2: Proposed solution
Web api application deployed on IIS 10 on laptop, with following settings in IIS
Binding Section :
IP Address: All Unassigned
Port : 4041
Host name : xyz.com
Also made the entry in the host file as
127.0.0.1 xyz.com
Now I am able to access the Web-API from laptop browser with the URL: http://xyz:4041/.
When I use the http://xyz:4041/ on mobile browser I am getting error “the site can't be reached” & “refused to connect”
Pls help me to resolve this issue.
There are many reasons for this error, you can try the following methods to fix this issue:
1.Clear cache and cookies and try again
2.Reset Your Chrome Browser Settings
3.Restart the DNS Client
4.Change the DNS Servers
5.Flush the DNS Cache
6.Reset the TCP/IP Address

How to get the URL an Android app is hitting?

I want to know if there's any way to find out the URL when any android app makes a network request.
Like, for websites, when we use Chrome Developer tools we can find out the URL of the ajax request made by the webpage of any website.
Is there any such way for Android app?
Use charles as a proxy server on your computer. Open your mobile phone network setting and set the http proxy and then you can grab request from you android app. Charles download url https://www.charlesproxy.com/。
Open WIFI wireless hotspot on your computer then connect to the hotspot。Now you can use wireshark or httpScoop to grab request from you android app.

Test mobile web app in mobile device's browser using localhost

I want to test a mobile web app on mobile device. I am currently developing my mobile web app. It is still on my local environment i.e. localhost:8080. Now I want to use same hostname and port to access this web app on my mobile device. I need this because my mobile web app is also using HTML5 Accelerometer API. I need to test if it is working. I can use google chrome dev tools to emulate responsiveness but I need to test it on real device.
How can I test it on both Android and iPhone?
UPDATE
Below is my nodejs server code
'use strict';
var express = require('express');
var app = express();
app.use(express.static('./dist'));
console.log('\n0.0.0.0:8000\n');
app.listen(8000, '0.0.0.0');
As Rosário said, you can connect to the same Wi-fi network as your computer and type in the computer's IP in your phones browser.
I don't know how experienced you are so make sure that you..
a) Use your computer's local IP. E.g. looking up your own IP on www.speedtest.net won't help since this is your public IP.
b) Type in the port in your phones browser.
E.g. if your computer's IP is 192.168.0.10 then you need to type in http://192.168.0.10:8080 as the url in your browser.
Simply connect your mobile to the same Wi-fi network as your computer. And then Enter the Computer's IP on the mobile's browser.
Android app "KWS"
Its a good option to test webserver,

local web server not accessible on Chrome - Android

I am trying to access my website (hosted on intranet) for testing on Google Chrome for mobile (using nexus 5) and the website is not accessible (on the same network using Wifi). If I access my website from any other pc on the same network it loads the webpage. I just checked that network connection is working fine and on my mobile i am able to browse any website on internet. I found the same behavior on android. Please guide me if there is any settings in android/chrome to access local server. The address of my webserver is like "http://my-server/webapp"

what changes i have to do to make my android application work on real mobile

i have an android application works on emulator and connect to server localhost , send an receive data, i want to make my application on real mobile and connect it to localhost via wireless, i am using servlet to connect from mobile android emulator to localhost server, what is the changes i have to do? and can I connect to localhost via wireless or i have to buy a real host?
Firstly, check the URL and change the IP address from that of the local server to local IP address. Make sure that the mobile device is in the same network with the computer to access the script that fetches the API. Then service the request to get the results in terms of Javascript Object Notation (JSON).

Categories

Resources