Connection problems in localhost from my android device - android

I'm trying to access localhost from my android device. I've tried 192.168.1.5:80 (which is my localhost ip address in my laptop). Both my android device and my laptop are on same gateway.
Can anyone tell me what i've done wrong or is there any firewall that is blocking my localhost from being accessed?
Help me out guys. Thank you in advance.!!

USB doesn't provide network to mobile device. If it's connected to your wifi, then hit your laptop address provided by the router. If it's connected to your mobile network, then first find out your router external IP address, then forward some port to that 10.0.2.2:portno and finally you'll be able to see that server from your device.
Edited:
I use my local ip for that i.e. 192.168.0.1 and it works.
and Let me know !

Related

How can I debug my apps wireless if IP address is unavailable?

I followed all instructions found here: https://developer.android.com/studio/command-line/adb, still can't find my device's IP address, because it's unavailable:
What could I possible do? I don't want to root my phone, and I can't run the emulator on low-end PC. And BTW I'm using Alcatel... The USB cable was borrowed... Please, help!
For wireless debugging to work phone and pc should be on same network. So one thing you can do is to create hotspot from mobile and connect your laptop to that hotspot.(You don't need internet for that)
When you get connected to a network IP address is assigned to your device.

How to connect localhost on Mobile over local WIFI?

I have a Web API Project hosted on my local system (Windows 7) on IIS7.
I am trying to access that Web API or for that matter another website hosted on the same IIS via my android mobile phone and My Mobile phone is connected to local wifi. But this IIS computer is connected to same network via wired LAN. Though I can access my router that is hosted on "xxx.xxx.1.1" IP Address from that computer as well as mobile phone but i am unable to access the IIS website from my mobile phone.
I tried turning off my windows firewall on the IIS computer where this website is running, but this didn't help as well. Although i can access this IIS website via another computer on the same LAN.
I think the issue is related to LAN or wifi but it should not be as the network and router for LAN and wifi are the same.
Need immediate help and how can i solve this.
Thanks
Can you ping your phone from your computer? Or vice-versa?
Access your router configuration and check for any access control setting that might be separating WiFi from LAN.
OK. When it was extremely urgent today, i found the answer myself. It was D link Router problem and here is the solution. Hope this helps others.
Check option Clients isolation in Wireless -> Basic.
If it turned ON - clients from LAN wil not access Wi-Fi clients and vice versa.

How to check localhost website to android phone

I need to check my website on my android phone , i wonder how can i connect it through localhost. need help please.
I'm using SQL Server as database engine.
If it's connected to your wifi, then hit your laptop address provided by the router. If it's connected to your mobile network, then first find out your router external IP address, then forward some port to that 10.0.2.2:portno and finally you'll be able to see that server from your device.

Charles Proxy Issue on Ubuntu

I am trying to do a debug session on my App (Android) by monitoring the outbound/inbound HTTP traffic.
I have followed these steps for the setup,
Made sure that my phone and laptop are in same network.
My laptop runs Ubuntu. So, I took my laptop's IP address from ifconfig. Let's say it was 172.x.x.x.
Configured this IP as the Proxy IP in my mobile, with port 8888.
Then, finally, having Charles Application running, I was hoping that my HTTP traffic would get routed via Charles Application on my laptop and I would be able to see the URLs referred.
Issues,
I cannot see my traffic in Charles Proxy application.
When I look into Help -> Local IP Address, I see that the IP is 127.0.0.1 and not 172.x.x.x.
But in my friend's laptop, who also has same setup, we see 172.x.x.x as the Local IP Address.
What am I doing wrong here? Does /etc/hosts affect this setup in anyway?
I have found couple of solutions for this. Both will work -
Note down your actual IP address from the IFConfig.
My actual IP here is 172.16.16.22.
In your mobile wifi's proxy connection, enter this above IP address and 8888 as port value. You will start seeing traffic in the charle's proxy application.
If you are in office WIFI, it is probable that VPN has some issue. In such cases, connect to the VPN from the VPN software provided to you by your office. This will follow same procedure as you would connect to your office network (VPN) from your Home WIFI.

Android network addresses

I have a tomcat web server running on my local machine. I also have a HTC desire and a Galaxy Tab. my problem is, I cannot connect from my real android device to my local machine. When I try to connect using the emulator, everything's fine. Emulator works with communication to the address:
10.0.2.2, but the real devices don't
Does someone know the solution, or why there's the problem?
You have to get the exposed IP address of your local machine and connect to that. If you are behind a router, you will have to make sure that it allows the packets to pass.
Are you using network or WiFi? You should be on WiFi and connecting through the same router to have 10.0.2.2 accessible.
Also make sure you have your local machine's incoming port (I'm assuming 80) open and reachable from the outside.

Categories

Resources