How to run a server in mobile app over hotspot - android

I want to run a server(MQTT/HTTP) in my Andriod app over Hotspot. Nearby devices connect to mobile phone over phone's hotspot connection. Assumptions are that my phone has enough mobile data and hotspot support is enabled by the service provider.
Is it possible to connect devices over phone's hotspot?

Probably not. Most devices restrict all access between devices connected on the hotspot and the host. This is a security measure and can't be turned off.

Related

Bluetooth hotspot and Wifi simultaneously in the same app

Is there a way to create an app for ios/android that can be smart enough to connect to (wifi / cellular) AND a bluetooth hotspot at the same time?
successfully managed to connect to the bluetooth hotspot and access data however when the phone is on bluetooth it cannot access the internet through cell or wifi
Needs to be able to connect to a bluetooth devices hotspot and access its local host aswell as be able to connect to the internet through wifi/cell at the same time
Or if there is a way to tell the app that any request to the IP of the bluetooth device will go via bluetooth and all other requests through wifi
the worst idea so far - alternate connection between wifi and bluetooth so that both never work at the same time. Possible app permissions nightmare
ideas welcome

Connect Android to laptop without Internet connection

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.

Google Nearby blocks Android application accessing to Internet - it switches to Wifi Direct automatically

I am having a problem with Google Nearby and WiFi Direct.I am developing an Android application which will run on two Android devices simultaneously.
These devices are connected via Google Nearby and in the same time both Android devices need to be connected to Internet for some API calls.
But sometimes,Google Nearby enables Wifi Direct automatically and in that case the devices are unable to access the Internet for API calls,hence the requests are failing.
I am unable find a way to prevent Nearby API from using WiFi Direct as connection medium in Lenovo Tab 7 Essentials devices.
How to programmatically control Nearby connection like "not to use" WiFi Direct?
Kind regards..
Use P2P_CLUSTER; P2P_STAR is inherently disruptive.
P2P_CLUSTER will use Bluetooth and LAN to connect your devices, so expect slower speeds if you're not both connected to the same router.
P2P_STAR will use Bluetooth, LAN, and Hotspots to connect your devices, so it gets higher bandwidth but it can cause devices to disconnect from their Wifi network.

wifi direct queries

I have 2 queries related to android wifi direct.
I am able to connect my motorola phone with Redmi via Wifi Direct. However when i try to connect my Motorola phone with Xiomi device it fails. So is there some device compatibility issues when working with Wifi Direct? I couldn't find any answer online.
Once 2 devices are connected via Wifi Direct, i don't get to decide which device gets groupadmin role. But only client can send files to server. But how Shareit allows any device to send data in any direction?
Thanks!

Do Android Wear devices have an IP-address?

Android Wear devices use bluetooth to connect to the internet, via your smartphone.
Does this mean the Smartwatch has its own IP on the local network?
Probably too late to reply but yes android wear devices do indeed have their own IP.
One way to find out is to debug over wifi under dev options. Once connected correctly, it should display its IP on the network with port 5555.
Alternatively, disable Bluetooth on the device, enable wifi and scan the network. Android wear favours Bluetooth connectivity so its important to disable it.

Categories

Resources