I created a WiFi-Hotspot with Android 10, and want to connect to it with the same phone. Is this possible with some "hacks"?
I know, it's a weird question and you may ask why I need this. The reason is that my provider granted me mobile data usage, that I only can use for sharing via hotspot. I don't know how they do it but it really only works for other devices connected to my hotspot - I myself can't use it. I also don't have a spare phone where i could put in my sim card and let it act as a router.
TL;DR: No, you cannot connect a device to its own hotspot, because devices only have one Wifi interface and those cannot send and receive transmissions at the same time.
You can find more about the topic on quora
https://www.quora.com/Does-my-own-hotspot-work-on-my-phone-or-just-other-peoples-phones.
Related
I need some clues how to approach my app. I have android device which provides HotSpot/AccessPoint for other devices. And this device which provides hotspot for others wants to get some data from internet and broadcast this data to devices which are connected to this hotspot. Ofcourse all smartphones must have installed same app.
Is there way to achieve that?
Thanks You!
So there's a requirement for an app that will communicate between devices if and only if its connected to the same local network.
E.G: Device A and Device B are connected to Wi-Fi network Z. The app will allow both the Devices to communicate between eachother (send messages/videos)
I've been researching the past couple of days but unable to get clarity with what I've found so far. (I'm confused between NSDManager, WifiP2pManager, etc. as to which one suits my requirement).
I just need confirmation between which concept/methodology to follow. Please help.
From my personal experience, WiFiP2PManager should do what you want. I have used it to connect two devices over the same WiFi network. It also allows your device to view all the other devices on the network and enables you to connect to them. Once you have connected to the device, you can then send messages across the WiFi network. This documentation does a good job of explaining how to use WiFi P2P and how to get started.
It also explains how to view devices on the network, how to connect with them, and how to transfer data. This should suit the requirements that you requested.
You can use NSD, but according to the documentation that is mainly used for giving your app access to services provided from other devices on the local network. It would allow your app to do file sharing with the other device by requesting a service.
After searching it up, I have concluded that WiFi Direct is the same as WiFi P2P. They both use the WiFiP2PManager.Here is a link for information about it.
You can use Network Service Discovery to find and connect to instances of your app. You can then open a socket connection to facilitate communication.
I created and example app on Android and on iOS that does this which I link to and explain in great detail here: http://brendaninnis.ca/connect-nearby-devices-part-2.html
I need to connect multiple phones to each other using wifi, without there being any internet though.
So i was thinking if this can be done by turning on the hotspot on one phone and allow the others to connect to it, can this be done ?
Or is there any other way to connect multiple phones via wifi ?
Any help is appreciated .. thnQ
To send and receive UDP messages you can using the following technique:
https://code.google.com/p/boxeeremote/wiki/AndroidUDP
The simplest way to explain this is that the UDP packages can be transmitted on a network with no particular destination set. Applications can pick this up and then decide if they want to handle the message or not.
To connect the devices you can use either a mifi dongle or put one of the phones into tethering mode:
https://support.google.com/nexus/answer/2812516?hl=en
Of course this is limited in range to the hosting mifi or phone.
I'm doing a research because I want to develop an app to which different devices connect.
The app can be an Android or iPhone smartphone. It will be for mountain equipment devices and sensors, so no wifi router is availabe. It needs long range, so Bluetooth is not an option.
I'm thinking on creating a hotspot in the smartphone and connect the devices to this hotspot. In this case, I'm thiking of this way of doing it:
Programatically create the hotspot in the smartphone. In Android, like this: http://www.whitebyte.info/android/android-wifi-hotspot-manager-class
Set up the name of the hotspot in the devices so they know where to connect. Pressing a button, they connect to the hotspot.
The android device broadcasts its IP, so devices know where to connect.
Devices connect and send the data.
I think this could be a real scenario, but I'm worried about:
Maybe there's a design flaw in my scenario that I'm not seing.
Batteries on the devices: how do batteries behave through "intensive" use of WIFI? (sending small amount of bytes of data every five minutes, e.g.).
The ability to replicate this scenario on an iPhone. Can it be done, or should the user manually create the hotspot to do this?
Any other feedback that I couldn't be thinking of.
Thanks.
Yes, on Android all of that can be done and should work fine.
Yes, you can programatically configure the hotspots info in the client.
Another way to make the connection (other then hotspot broadcasting its IP) is for the hotspot to reads it ARP cache, i.e. parse the cache to find the IP of all of the clients connected.
Battery could be a problem. That doesn't really sound like 'intensive' use of the wifi, but it will still consume a fair bit of battery (I find that even just having the hotspot enabled draws the battery).
I don't know the answer for iPhone.
There are lots of post on SO regarding setting up AP (Hotspot) on android mobile. However, in all these cases, the AP is a conduit to the outside internet world. In my case, I just want a server application running over a mobile setup as an AP. And let all the client android mobiles connect to it, send their data and disconnect if they like. No internet connection is assumed (i.e, no gprs/3g etc).
My observations: If I setup a wifi AP (via settings -> tethering and portable hotspots) when it is also connected to GPRS, then another android phone can successfully connect to this AP and send the data to the application. However, if I disable the GPRS, even though the client shows that it is connected to the AP, it can't seem to send any data. It seems that an external internet connection is a necessity for the AP mode to work.
Is this understanding correct? Or am I setting something wrong?
I know that I am late to the party (more than 3 years late :) but I was searching for a solution to this problem and stumbled upon an easy workaround. I am using a Nexus 4 with Android 5.0.1 and I can easily configure my phone to use it as an Android Wi-fi AP hotspot - without internet. Just go to Settings / Data Usage and disable "Mobile data" option under the Mobile tab. Then enable the WiFi hotspot option as usual.
I was trying to get this working in order to play with a VirtualBox machine from VulnHub.com that asked for a Bridged Connection when I was commuting to work (no Internet, but with my laptop and my mobile phone I was able to make it :)
I think you have used the internet IPs in your code not the local IPs for communications,is'nt it?
I have the same use case and was looking for the same info as you are. I checked that some of the WiFi-only tablets do not even have a HotSpot setting. Even the devices that do have it, if I remove the SIM card, I cannot enable the HotSpot (I get a message asking me to insert a SIM first).
It looks like our use case is not supported by Android. Rather, the HotSpot feature was not designed with our use-case in mind. I mean, why would an end-user want to use an Android phone or tablet in a HotSpot mode if it didn't also provide outside connectivity?