I am looking for a way to scan for all devices on a same network (connected to a same AP.)
For example, I have a RaspberryPi device, and I want to connect to it from Cordova app automatically - without user interaction. Therefore I thought I'd do a scan of all devices and just return the IP of Raspberry device.
I looked in Cordova plugins and only found Network Information which is not capable of doing it.
I also tried using Cordova Service Discovery plugin which does a search for active SSDP / UPnP / DLNA services on a local network. This does work, I am able to retrieve the Raspberry IP by running a SSDP service on it. How ever the problem is that it doesn't work on newest Android versions. (I didn't test on iOS yet)
Related
I am new to Android programming and was wondering if it was possible to connect an Android device with a BLE Peripheral, without needing an App.
I am experimenting with the Node.js package "bleno" for the peripheral and connecting using an app and even a webapp are working just fine, but connecting using the standard android settings functions dont work. The device does find my peripheral after scanning but when I try to connect with it it always returns that I need an app.
Is this a problem of bleno or does this not work that way in generell?
If the peripheral has for example a HID GATT service exposed, then you can pair and connect to it through the system settings. This means BLE keyboards and mice can be used without any app.
If your peripheral only has custom services or only services the OS knows nothing about, then you will need some app to connect to it.
Some time ago I implemented a radvd daemon in a linux device in order to send icmpv6 Router Advertisement messages to its tethered devices.
I took the radvd version 1.9.2 from this site: http://www.litech.org/radvd/. I compiled and installed it and wrote a small module to manage it (launch radvd daemon, define radvd configuration file according to device settings, etc.)
I am looking for doing the same in an Android device with Nougat version. I assume that the device properly received an IPv6 address from the system.
So far I founded radvd version 1.8.5 for Android in this site: https://github.com/ddrown/android_external_radvd.
Is it a good version to start with in Android or does someone know a better option?
I enabled bluetooth tethering on one Android Phone and connected Another Android Phone using Bluetooth. I could observe that the tether enabled Android phone was capable of sending router advertisement. The Phone on which i enabled bluetooth tethering was connected to a mobile network that gave it an IPv6 address. So I dont think there is any need of a seperate radvd but I am not sure yet on which module on Android is helping to send router advertisement probably dnsmasq*
Above exercise helped me to know that Android has the capability of sending router advertisement without the need for installation of another module.
For some special, personal needs I want to use a TIdHTTPServer (component from the Indy project for RAD Studio) on an Android device through a mobile network connection to which I can connect with a client, like a browser, wget or whatever.
My FireMonkey application works as expected on Windows and Android using a WLAN connection. But on Android with a mobile internet connection turned on and WLAN turned off, I cannot establish an external connection to the TIdHTTPServer server running on Android. No instant connection discarding - it's a timeout.
I think it might be something Android related or maybe it has something to do with the way how my cell phone provider handles mobile connections. Maybe they block or simply don't redirect external (mobile) connections, like NAT "firewalls" do, where one has to create a port redirection and so on.
I also tried to add the mobile IP and the port of my server app to the bindings of the TIdHTTPServer component without luck (error says that the address and port are already in use). IP is version 4 and Android is version 6. INDY is 10.6.2.5341.
Is it possible to use a server on Android with mobile connections after all? What are the obstacles? Maybe I just forgot to set certain app rights?
I can't find any documentation on Android Wear that shows how to create an app that leverages the fact that some watches (like my Samsung Galaxy Gear) can now connect directly to the internet via wi-fi when the phone is not around.
I have a few apps that generate https requests to access a REST service and I would like to know if these can be directly called from a Wear app connected to wi-fi (no phone).
Similar questions don't seem to answer this:
Direct internet connection on Android Wear?
https://stackoverflow.com/questions/26062487/android-wi-fi-direct-persistent-connection
Android: Establish "Wi-Fi Direct" connection with networked devices
My tests on a Wear emulator tethered to an internet enabled Phone emulator show:
java.net.UnknownHostException: Unable to resolve host "api.xxx.com": No address associated with hostname
But of course there's no direct wi-fi connection on the watch emulator so my next step is to try on a real watch and phone.
My suspicion is that Android Wear's data API handles this transparently so direct http requests seem impossible.
Best, thanks in advance for your help.
Even if Android 5.1.1 support Wi-Fi Feature. Android Wear on Wi-Fi: Using a smartwatch without a phone nearby
You should stick to the Data Layer API, you cannot send http request directly from watch. Fetch internet data from the phone, then transfer it to watch with Data Layer API.
You can see this Does Android Wear support directly access the Internet?
And this document Always-on and Wi-Fi with the latest Android Wear update
From the last update its possible to make http requests over wifi using android wear. You can even connect a bluetooth headphone to it to use with some streaming app.
While on wifi, if your mobile phone is connected to the internet too (dont need to be the same wifi, can be even 3g) it will act the same way it would when bluetooth connected yo our phone, but with its own internet access.
This dont mean apps will change their behavior, because most of them are coded to make the requests from your phone, but if you have an app that make direct networks requests, it will send them from your watch without advising or needing your phone.
How to do networks requests on android wear
Just use the same network requests libraries you would use on a normal Android mobile application, like volley, retrofit, okhttp. The code is exactally the same, and by the way, any Android Mobile library works with Android Wear too.
I am working around wifi direct and NSD (Network Service Discovery) to transfer files.
NSD: where serivce has been created and can scan the other devices which are publishing the same service with in the same network.
WiFi Direct: This is used to scan the near by devices without network
WiFi P2P Network Serice Discovery: This is used scan the service near by devices where other devices provide the same service (NSD+WiFi Direct)
As per requirement, I need to give compatibilty to iOS device even though both are not in same network. I came to know that NSD is similar to Bonjour service by iOS.But this can be possible when devices are in the same network.
Is there any way to get connect to iPhone when both are not in same not network?
Ignoring the intricacies of getting Android and iOS to play nice together, it is possible to make them think they are in the same network without physically being there. If I understand you correctly, seems like you have two options:
Setup up a VPN server in network A and the device in network B connect to it. This would make the device in network B think it was on network A, and have access to all LAN services (such as NSD).
Set up VLAN trunking on a switch and put network A in the same network as B.
Option 2 would only work if they were geographically in the same area (like on the same campus). Option 1 would be preferable if they were geographically disparate, or you were unable or unwilling to make the infrastructure changes necessary to support option 2.