So, what I want is just to scan the environment and see if any packages are sent without pairing or connecting to a device. Just a general scan of bluetooth in the air and being able to see some of what comes up, like packages exchanged and maybe some information of them. Everything I've read so far is about pairing or connecting first.
Thanks in advance!
The question is old, but since nobody gave an answer I try to fill the gap.
Bluetooth is, because of its technical specifications (frequency hopping etc.), difficult to sniff. A monitor mode like in WiFi doesn't exist out of the box. You would need to scan all Bluetooth channels at the same time. And then there is the challenge that since you managed to detect something, you need to know the next hop (to which channel the devices jump next). There are commercial hardware that can do that. Also some open source projects come up like Ubertooth, but with less capabilities.
You could try to purchase an Ubertooth and play with it.
I want to know if there is a way to get the details of the bluetooth chip use in a device (other than tearing it down)
Reason: I have a third party lib that does not seem to work with certain phones. The lib once started, blocks any wifi connection..It completely shutdown the Wifi as I get disconnected from the network I am connected to.
I have never heard of a way to get a bluetooth chip, however please see this question on how to get the device model. This should hopefully be good enough to detect which models yours will and will not work on (I'm guessing you simply need to exclude older phones).
We have a custom Android device with WiFi/Bluetooth antennae that we intend to operate without direct user interaction (like a router). Normal operation doesn't require any visible display, but troubleshooting or setup will. The device has an HDMI port for connecting to external screens but no built in display.
While we can plug in to an HDMI TV out of the box, the device will generally be in locations where big screens are inconvenient. We would like to make it convenient to display onto laptops or other small screens; the only other ports we have are USB-A receptacles, so I'm assuming any solution will be network (wired or wireless) based.
Edit: I had originally been looking at Chromecast before realizing it was an HDMI plug. Is there a simple way to cast to computers or is a hardware solution likely to be the most viable?
I'm still in the planning phases so will post more information as I run in to it. Am just trying to avoid writing a bunch of code that won't ever work; any alternative suggestions are appreciated. Thanks!
Previous text:
Does anyone have suggestions on how to approach this? My initial research led me towards using MediaRouter to connect to a Chromecast dongle (Device will run Android 4.4.2 ), but I'm unsure if the API gives enough control to find and connect without a display in the first place. I could only find examples of users selecting what to route to, and didn't see any proximity information in MediaRouter.RouteInfo to base make a decision based on (a la RSSI in Bluetooth). Finally, I wasn't sure if this supported devices list meant a custom device wouldn't work.
I'm trying to make an app on an Android device that will control an application on an iPad or Android tablet. (I'm testing with an Samsung Galaxy S2 and an iPad 2).
The application is pretty simple for now. When one selects a colour on the Android mobile, that colour displays on the tablet device.
The question is, how to connect the two devices. Just now I've verified that I can pair the two devices using Bluetooth. Also, the Samsung has a "Kies" Wifi Direct feature (which I don't understand fully), that allows the iPad to connect to the Galaxy as a wifi hotspot.
The connections are there, but I don't know if either protocol can be used to actually get the apps to talk to each other to get the control I'm looking for.
Should I be using Bluetooth, Wifi, or something else?
And in whichever case, how?
My opinion is that you should not stick so much around the physical medium used for connectivity either is WiFi or Bluetooth. You should abstract this aspect, in both cases you will be using sockets (I'm speaking about Android), if it's Bluetooth you will be using Bluetooth Sockets, if it's WiFi: TCP sockets. You could have a intermediate layer that abstracts the type of connection and through a factory to use either Bluetooth or TCP.
Bluetooth - http://developer.android.com/guide/topics/wireless/bluetooth.html
For WiFi you should study if P2P would help.
You will need two applications:
- one on the tablet - the server which listens for commands from the client (change color, do this or this)
- second on the smartphone - the client which sends commands.
I've built a few apps that do exactly that between iPhone and iPad. But the principle is the same. I used Bonjour networking. It's just a fancy name for ZeroConfig networking between devices. It's written originally by Apple but it's open source so there should be Android support out there for it too. Really simple and easy to work with.
If you already have a working connection then you already have the first half of your answer, that said you should really consider implementing a solution that uses a variety of connection types, WIFI, Bluetooth, etc.. The question I think you are really asking is how to pass data and messages between the apps once you have the connection.
There are a lot of ways to accomplish this. You could implement your own lightweight message passing system. If you haven't done this before it is more complicated than it originally seems, especially as you would be required to implement the system for each OS you end up using.
Should I be using Bluetooth, Wifi, or something else?
It depends on what situations you want your program to work in.
Bluetooth can provide a direct connection between your devices. A potential issue with bluetooth is that it has a limited range. If you're devices need to be far away from each other, you may want to go with wifi. Otherwise, bluetooth could work great.
If both devices are connected to the internet, you can make them talk to each other through there. The advantage of this approach is that it doesn't matter how far apart your devices are as long as they're both online. A disadvantage is that you'll have to figure out how to find the tablet's ip address before you can talk to it. This is actually a HUGE disadvantage because it can be quite problematic if both of your devices are not on the same wifi. You could have the user type in the destination ip address, but you'll have problems getting it to work if the user is behind a router (which will almost always be the case). The point is, it gets hairy.
If both of your devices are on the same wifi, you can use ZeroConf AKA bonjour (like Dancreek said) to figure out what ip address you need to send info to. I've previously used a library called jmdns (easy to find with google) to implement zero configuration networking. It's good because the user doesn't have to worry about ip addresses... it's intuitive for the user.
And in whichever case, how?
Networking is a pretty big topic, so I can't expand on this question to much. Short answer is, it depends on what method you choose. Search for some tutorials and start by getting one of your devices to send something as simple as an int to the other.
I'm looking for a way to scan for android devices in my area.
It should work without internetaccess nor gps.
Just knowing the mac-address is enough for this app.
The first way I was thinking of was to use bluetooth.
It's possible to scan for bluetooth devices, but it isn't possible to make your own device visibile forever (Android docs say that's possible, but it's limited to max 300 seconds).
The next what came up in my mind was to scan for wifi networks.
Almost every android phone uses wifi.
It's possible to scan wifi networks.
But is it possible to set my device as an accesspoint?
It can with systemsoftware but I would like to do it programmatically.
Does someone know if that's possible? Is there another way to let devices 'see' eachother?
Thnx
But is it possible to set my device as an access point?
This is possible by reflection, but not recommended. However you cannot force others to join your Wifi network. That is entirely their prerogative.
Is there another way to let devices 'see' each other?
Yes it is possible to see other device on the network. Check out these answers. If you have your apk installed on their device you can even try WiFi multicasting.