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!
Related
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.
I have a device that creates a WiFi network that is not connected to the internet. This device hosts a website using IIS. To operate the device, a smartphone connects to the WiFi and browses the site. The smartphone needs to get data from an api (internet) and pass it to the website on the device.
I have tried to remove the default gateway setting from the DHCP server on the local WiFi, but this is not permitted on the device.
I have not been able to find an app that will allow both WiFi and Cellular data to be used simultaneously.
If I were to allow the device to connect to a hot spot that the smartphone creates, the smart phone cannot access the device's WAP.
The next option I'm considering is to toggle the WiFi Off and On during the process.
I'm wondering if anyone has another solution to this issue?
I have a Bluetooth device through which user can take photos. After taking the photos Bluetooth device hosts all the images on its own HTTP server (10.0.0.1), so that other devices can connect to server using Bluetooth and access photos from server using REST APIs which are exposed by server.
Steps to connect to Bluetooth device (Server)
Go to Setting, enable Bluetooth
Select Bluetooth device
Bluetooth device setting ("Paired Bluetooth device")
Select check box for Internet access.
Through this i am able to access Bluetooth server but my WiFi automatically gets disabled and I am not able to access internet.
If i uncheck "Internet access" check box in "Paired Bluetooth device setting" then I am able to connect to WiFi for internet access.
Is it possible to have both WiFi internet as well as Bluetooth internet at the same time? So that my app can connect to Bluetooth device to get the data (images) using REST APIs and post to remote server using WiFi.
I am using Nexus 7 tab for development which is running on Android 4.4.4.
1. ...so that other devices can connect to server using Bluetooth and access photos from server using REST APIs which are exposed by server
If the photos are on the server, devices can connect to it using wifi/internet also..right? To access the APIs and get the photos..
Why do you want other devices to connect to server using bluetooth to access photos from server using REST APIs
2. Is it possible to have both WiFi internet as well as Bluetooth internet at the same time?
Leave aside Bluetooth internet, there have been some issues related to Bluetooth and Wifi, even more with Bluetooth Low Energy and Wifi, many have been device specific.
Regarding what you are facing, there are issues on Android Open Source Project - Issue Tracker and other blogs also;
Issue 39995
Issue 41631
Nexus 5, Nexus 4 and Nexus 7 (2013) Android 4.4 Bluetooth Issues
[Although i haven't faced that issue in Nexus 5]
I have seen the same in MotoG also, turning on Bluetooth weakens the Wifi functionality.
In your case, considering nothing can be done with the device and its hardware,
you can check with the connections whether it happens intermittently, try to connect or send the request to server a couple of times.
3. ...app can connect to Bluetooth device to get the data (images) using REST APIs
If it can "connect" to the Bluetooth device, i suggest you try and get the images on the established connection rather than REST APIs. Simultaneous internet access through two different sources doesn't happen, even with the 3G and wifi :)
Just out of curiosity, when you are connected to the Bluetooth device, why do you want to add the necessity of internet to get the data?
Another approach, gets ugly but would work: Can you get the data that you need and ask the user to switch off the bluetooth so you can send the data..which you might need only on certain devices, if you separately get the data from the established bluetooth connection only
Is it possible to connect two android phones (rooted) with wifi programatically and exchange data?
I know it is possible to do tethering using wifi-android-tether. But i need to establish the connection, and exchange the data, all through my android application. User intervention like switching on the android tether app manually is not allowed.
SO basically its like, if i run my app on two droid phones, they should do the following,
Detect that they have wifi.
DEtect that the other phone has its wifi on.
Establish a connection ( similar to a PAN in bluetooth ).
Exchange some data.
Use WiFi Direct. The sample codes in the SDK package will do for testing Peer-Peer connectivity.
Can someone explain a couple of very simple concepts to me - I'm interested in mobile devices running android and how they are identified over networks. Some scenarios:
Device is connected over WiFi - presumably the device has a standard IP address as with any host and can communicate with any other android host over TCP/IP (assuming it knows the participating device's IP?
Device is connected over bluetooth - how are devices identified in this case?
Device is connected over mobile operator's network - this is the one I'm interested in and confused by - is there anyway for two or more devices to discover each other and communicate via the mobile operator's network? How does a device communicate with a backend server in this scenario? In other words, how do apps and devices communicate when not connected to a WiFi network?
Thanks for any advice..
I'm only sure about the bluetooth thing, so i only answer this part:
The Bluetooth interface on your device has an MAC adresse. So while communicationg over Bluetooth you can assume that this MAC adresse is a unique identifier for a specific device. You can also reach other devices by establishing a connection over this MAC adress- However, to get this mac adress in the first place, you have to know it from somwhere, or you have to search for other bluetooth devices in the reachabla area before.
WiFi and 3g both attach the [mobile] device to the internet so it can make internet connections. 3G assigns a publicly addressable IP to the device, so one could, presumably open a server socket and listen for connections. The client would have to know the mobile IP, which may change quite frequently.
Bluetooth is more geared toward close-proximity. Devices in the vicinity can be connected to, after you have paired with them, which requires the cooperation of both devices which are to communicate.
If the goal is to produce an application which connects to nearby devices, I can think of the following ideas:
3g: all devices running the client register their position with a central database server. If the server detects that two clients are in close proximity, let them know so they can connect through the internet or through the server
WiFi: you could use the same idea as 3g, or use broadcast/multicast packets to broadcast your presence. Other apps can listen for those broadcasts and discover which other devices are near.
Bluetooth: A little trickier, as a device must be placed into discoverable mode in order for others to "see it". Discoverable mode is a temporary state and only lasts about 30 seconds (at a time).