How can I make a port forwarding from a android device whose Hotspot is ON to another device who is connected to that hotspot.
I want to connect to my system server which is connected to a android Hotspot from another device which is in another network. When I use the pubilc IP of the Hotspot device I am getting access to that device only, I am not able to access to other device which is connected to it.
As how the WIFI-router provides the port forwarding in the same case I want in android when I am using Hotspot.
Related
I was trying to setup mitmproxy to see the API requests that apps on my phone make. As the docs say I have to add proxy URL in the android phone. But as far I can find if the Android phone is connected via Wifi it can get the proxy settings. But I don't have a Wifi router to connect to Wifi. I only have Internet on my Android which I use on my Linux computer using Wifi hotspot or USB tethering.
Is their anyway I can get those proxy settings when I use Wifi hotspot or USB tethering?
Say I have a laptop (Windows 10) and an Android phone. The laptop does not have an internet connection and the Android does not have an internet connection.
I have an Xamarin app that uses a C# Web API that is deployed to the laptop (for testing). How can I connect the mobile to the laptop without any form of internet connection? I believe I have two options:
1) USB cable
2) Bluetooth
I believe I have to install a wireless hotspot on the laptop and then a reverse tethering on the Android.
Have I understood this correctly? Do I have to do this regardless of whether I use a USB cable or a Bluetooth connection.
Tethering is the name given to a mobile that acts as a hotspot. It make use of a network interface (Wifi, Bluetooth, USB port acting as Ethernet...) to share internet connection through the selected interface.
As you'll note I'm not incluiding mobile data in the list. Mobile data is used to connect to Internet. So your mobile is capable of connecting to internet via mobile data and share it via any other interface, i.e. Wifi, Bluetooth and USB (Ethernet)
At least in my mobile im able to just enable Tethering configuring it from Settings -> Wifi connections -> Share internet. Here I can switch on/off the desired interface: USB, bluetooth or Wifi. I can enable just one, both or even all of those
As far as I know a Xamarin app is an android app that embeddes a website and, optionaly but highly common, uses a server as an endpoint (your laptop in this case), also known as API.
So as you ask you don't want to have internet connectivity, all the connections must be made in a local network. To do so you could just enable tethering and turn off mobile data on your mobile. Then on your laptop, connect to your new network over wifi, enable ethernet or connect via bluetooth, depending on your choose.
Of course, you'll have to handle firewall on your laptop to ensure connections are made successfuly. But you should be able at last to ping each other.
I want to send data from a device to an Android Phone.The Android Phone and
device are connected through hotspot. i.e. Device is connected to Android phone through hotspot of Android.The device has capability to send data over sockets provided an IP and port. what destination IP should I provide to the device so that it can connect to my Android device on a given port. I have written the corresponding code on Android device to receive connection on a given port.
The Android phone will act as the gateway for your other device. Therefore, to find the IP of the Android phone from the other device, you have to inspect the routing information to get the IP of the gateway.
Command line
On the device connected to the access point provided by the Android phone:
$ ip route
default via 192.168.43.1 dev wlan0
...
You can validate this information by checking the IP of your Android phone:
$ adb shell ip addr
...
6: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
...
inet 192.168.43.1/24 brd 192.168.43.255 scope global wlan0
This should show you the IP assigned to the WiFi interface of your Android phone. It should match the gateway IP seen on your other device.
From code
If you have to obtain the gateway IP automatically, check here for some code examples.
I want to send a command to a device using an android application which supports gprs tcp/ip communication. I don't know how to establish connection between device and android application.
You need to know IP address or DNS name of the device and TCP port.
Then you can just open socket and read/write there.
However you need to ensure your device has Internet access and accessible from the Internet.
I had this chat program using sockets and ip addresses.
I tried the code and was working perfectly on my android devices connected via wifi to my router.
I've got the client and server codes from here http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/
The code gets the ip address assigned by the router to the android device. The problem is how will I be able to communicate an android device connected to the Router A via wifi to an android device connected to Router B?