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.
Related
I can't seem to find a solution for this. Either it hasn't been asked, is impossible, or I used wrong key words, so I'm gonna try and ask here.
My problem is that I have two phones and a laptop.
My Laptop has WAMP 3.0.6 on it and has my database and server.
One phone is connected via tethering USB cable to the Laptop and has its Tethering Hotspot on.
The other phone is connected to the first phone via Wifi to Hotspot connection.
However, when I try to use the method of http://IP:PORT on the second phone, it shows a Not Allowedor net::ERR_CONNECTION_TIMED_OUT warning instead of my Localhost page.
Can anybody give some help on this?
I'm debuging an android application using my android smartphone (Sony Experia) and I need to connect to the computer's local host through the android app I'm developing. I tried several methods (USB tethering, Wifi hotspot) but I couldn't achieve it. Please support me with a solution. I know that simply 10.0.2.2 is working well on the android AVD but I've no idea about real devices.
I'm using Microsoft Internet Information Services (IIS) as my server and the web application is also running well. I don't know whether the firewall is blocking the port or not.
This should work:
Unplug all the network cables on the computer and turn off your wifi.
Turn off the wifi on your Xperia.
Connect your Xperia to your computer via USB Turn on "USB Tethering" in the android menu. (Under networks-> more...-> Tethering and portable hotspot")
Get the IP of your computer that has been assigned by the USB
tether cable. (open command prompt and type "ipconfig" then look
for the IP that the USB network adapter has assigned, It is Under 'Ethernet Adapter Local Area Connection' title. The Value for the IPv4 address is the One you need.)
Open a browser on the PC using the IP address found instead of
localhost to test. i.e.
http://192.168.1.1/myWebSite
Open a browser on the android and it should work.
If it is working on your PC but not in your device, You have to allow your http through firewall.
Follow How to enable sharing of web site on localhost? to do it.
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 !
I know that when we use a virtual device for testing android applications, we have access to the machine with this IP : 10.0.2.2
But when I use a real hardware phone instead of a virtual one, I don't know how I can access to the machine?
Thanks for any help...
NOTE that currently I can run my applications on the connected phone.
To connect through Wifi
Install connectify software in laptop to make a wifi hotspot. Then connect your phone to this hotspot.
You can find your local network's IP by go to cmd or press Winkey + R then type in "ipconfig". It will give out some information and your local IP should look like 192.168.1.x .
Using this IP you can connect to your local host from your phone
To connect through USB:
You should go for REVERSE TETHERING......
May be these links would help you.
http://www.orclage.com/connect-internet-pc-laptop-android-mobile-phone/
Is there any method to access the android app database from xammp server using android device using only usb cable and no other mean, like wifi and mobile network.
I have gone through many articles and forums to find out this problem but haven't find anything helpful. I am trying to connect the database on localhost xampp from android device (Samsung Galaxy s 2) through my app. I have tried
127.0.0.1
127.0.0.1:80
127.0.0.1:8080
10.0.2.2
10.0.2.2:80
10.0.2.2:800
also tried my laptop ip address.
When i try to debug my app from eclipse on device, the app starts but when i click to get data (product list) from localhost the device just say that "unfortunately Myapp just stop working" and app is closed. This is when i am not using wifi on my device, but it works well when my device is connected to wifi. May be there are places when there is no wifi so in case usb option will be good.
install xampp
start Apache on computer where is installed xampp
run cmd.exe (menu
start -> run ...)
enter command: ipconfig
IpV4 Address is that what you need.
Input in android device's web browser the IP address (example: 192.168.0.23)
You will see xampp menu.
I'm don't belive this will be possible very easily since this would create a security risk for the pc (immagine somone charging his phone on your pc - and he's then accessing your pc just because its connected).
however, after a quick search i found that it might be possible using something called "reverse tethering" - also, it appears to be possible if the pc is running linux.
The problem is that your phone and the laptop have to share a network-connection together, otherwise localhost or any Laptops IP-adress won't be accessible. Maybe you could create an AP for your laptop (therefore connect your pc via Wifi to your Phone) - then the pc's IP-Adress should be accessible?
Maybe this Article will help you further...