Sharing Bluetooth connectivity over wifi - android

My computer does not have any Bluetooth capability, however it has WI-Fi capability. My phone has both.
I was asking myself if there is anyway to "stream" Bluetooth over WI-Fi?
Thanks!

The short answer is no. Easiest would be to purchase a bluetooth dongle for your computer.

Yes, tunneling one type of communication through another is generally possible (within the limits of the Android Bluetooth API), but as it is an obscure need you will probably have to write the bridging server to run on the Android device yourself - this is after all a site for questions about software development. Additionally, it will work best when the app hosting the server is in the foreground, as Android makes no guarantees about keeping services running in the background.
On the PC side, this bridged Bluetooth capability will probably not trivially present as an ordinary Bluetooth adapter, so you would be limited to using custom applications which known how to talk through your bridge. The exception would be if you also spend time figuring out how to write a device driver for your host operating system which presents it with traditional Bluetooth APIs, at least to the greatest degree possible.

Related

Android, Linux and iOS - using of Bluetooth and TCP/IP?

Since many libraries are meant to be used with TCP/IP, I was wondering if it is possible to activate TCP/IP and therefore TCP/UDP for Bluetooth connections. I found some information already like that it is called Bluetooth PAN and piconet.
Furthermore, I noticed that my Android device created a network interface with an IP upon a connection with an iPhone (after I paired it and hit connect). Nevertheless, it appears that interface cannot be used right away. I don't have the option to root these devices so it needs to be activated programmatically somehow.
Any hints? Is it actually possible?
Thanks.

Transform any devices into beacons : wifi + bluetooth (datzing like app)

I'm actually working for a startup I'm building with two other founders. On the side I would like to develop a quick prototype to be able to deepdive into a subject I can use on my project : beacons.
Here is what I want to achieve : I want to be able to use a device as an emitter (using bluetooth, BLE, or wifi) and the other one to be able to know when it enters the first one range. I need that to be able to do indoor localization (just a check in system, not to know exactly where people are in that specific location).
I'm used to code mobile application with Ionic and I'm more a Javascript developer. I saw that there is already something which fit to my needs : Dazting which transform every device mobile as "a beacon" with either bluetooth or Wifi. Problem, I want to do it on my own but to be honest I don't really now how they manage to do that with Wifi. I know that there are some libraries to emit with BLE but what about bluetooth ?
Does it mean I'll have to code it with native code ?
This is what I want to achieve :
Coding an hybrid app (will loose less time and one app for every
platform)
Transforming the mobile device into an emitter : with bluetooth or
wifi
Be able to know the distance between a device which will emit and a
one that will receive the signal
I don't want to go with beacons : I'm not going to use macro-location and buying beacons for my project at the start is not something we would like to do.
Any ideas or suggestions on how did Datzing manage to reach that goal ?
Thanks in advance.
Datzing relies on emission of Bluetooth Classic, Bluetooth LE and WiFi packets from a mobile device that is made discoverable, either programmatically or through manual selection in settings. The unique MAC address or SSID of the device can then be used to tie the detected transmission to a registered "Beacon" on the Datzing system. Basically it just registers the unique identifier associated with a Bluetooth or WiFi transmission with the Datzing servers so they can have meaning.
Using this technology to transmit on an iOS device is severely limited due to operating system restrictions. Users essentially have to manually go to settings screens to start the emissions. Android devices are much more flexible if you have a native app granted the proper permissions.
On the detection side, iOS is also much more limited than Android due to the operating system blocking access to raw MAC addresses of bluetooth devices and preventing detecting SSIDs of WiFi access points unless the network is connected. As of Android 6.0, access to the raw MAC address is also restricted, making such a system work less well with Bluetooth on newer Android devices.
On both platforms, iOS and Android, the ability to use these techniques to the extent they are allowed by the operating system are possible with native code. Doing so with Ionic or Cordova would require cobbling together a number of plugins (if they even exist) to bridge to the native features to access WiFi SSIDs and do Bluetooth discovery and scanning. This is unlikely to be a quick protoype.
Word of caution: It is always a good idea to try out a system like Datzing before trying to reproduce it yourself, as limitations often cause technologies not to live up to the claims of the marketing materials.

Pre-pairing bluetooth devices

I would like to be able to pre-pair bluetooth devices, to save the step of user confusion when using the app. I have discovered that there is a patent for
System, method and apparatus for pre-pairing bluetooth enabled devices.
I am looking at pairing an array of android devices with an array of embedded devices, so when the android device is set up, I can pre-pair it with the devices it needs to communicate with. I have considered maintaining a list of MAC-addresses that can be downloaded and updated by the app.
Is there a way to pair two devices without having to bring them into contact?
My memory is not exact, it's a while ago I poked around in the Bluetooth stack, however, I don't think this is possible.
Basically there is a white list (text file pretty much) which is kept by the system with devices that may connect to your phone, in order to access that white list outside of the Bluetooth api you need to be platform manufacturer. The Bluetooth Api is strongly guarded (by the specification), if you don't fulfill it you can't say your device supports Bluetooth. Pairing is an important part of the Bluetooth security model, I doubt even an oem would be allowed to do this.
One thing you could look into are Bluetooth low energy devices, those don't require pairing prior to connection (you should be able to connect if you have the MAC address), only Bluetooth classic requires pairing.
More info:
https://developer.android.com/guide/topics/connectivity/bluetooth-le.html
No its not possible unless you make changes to the ROM.
If the use-case supports,you can have ble devices advertising data in a pre-defined format so that the app detect your devices.Once you have recognized your devices,you can internally send a pairing request.

Convert application using wifi to application using bluetooth

I have an android app, it does the following:
Connects with a server to read and update a database at the same time as others.
I want to convert this to an app that does not need an internet connection. Therefore i would like to know if its possible to have an android device acting as the server with the database, whilst multiple phones connect to it via bluetooth getting and updating the information in the database?
Thanks
Yes. It possible.
However all of your devices will have to be located nearby, so they can connect to each other through bluetooth.
You can take a look at Android Bluetooth API.
However, my recommendation would be to use Wifi instead of Bluetooth. YOu will need additional WiFi router. However, you won't need to deal with Bluetooth API in such case.
You will only need to write a server on one of Android device and the rest of devices will work the same (as now)
There are a few options to doing so, that don't involve a server. Both of them require a slightly different approach than both devices connecting to a server.
Wi-fi Direct- Only available with Android 4.0+.
Bluetooth
Personally, I have been using the Bluetooth option, and not found it terribly difficult. Essentially, you have to do the following to make it work.
Have one of the devices listen for a connection. If it is unpaired, you will have to make the device discoverable.
The second device needs to initiate a connection. It can do this by looking at the known devices and trying to connect to one, or listening for a new device
After the two devices connect, they must initiate some kind of a communication protocol. The communication is essential a serial connection.
Blue-tooth requires that the devices be within about 10 m of each other. Wi-fi direct will allow somewhat further, but as mentioned, is less supported. It is possible to allow for both communication methods, but is somewhat challenging.

Android - communicating between two devices

What is the best way for an Android app installed on two devices to communicate with each other? Can the devices connect directly without using text messaging?
You have several options, depending on your requirements and setup:
If your devices are very close to one another (up to about 10 meters), you can communicate using Bluetooth, as Derek suggested.
If your devices are somewhat further away, but within WiFi range of each other (up to about 100 meters), then they can communicate with each other using the Peer-to-Peer WiFi API, documented here (part of the Android Wireless API). This does not require a WiFi router to be present, and the devices will find each other and communicate directly. This does however require Android 4.1 or higher.
The Android Wireless API will also work if your devices are on the same local network (i.e., use the same WiFi router), even if they are not themselves within range of each other.
If none of these options are viable/guaranteed, then I agree with Derek that the easiest way would be to use ServerSocket and Socket to create a server/client interface through the Internet. Here is a sample application doing that. The main problem you might encounter is that if the server is sitting behind a NAT (such as a home internet router), you will have to configure the NAT to forward the incoming packets to your Android server.
You can connect them via bluetooth using BluetoothSockets. Android developer website has pretty good documentation on this.
http://developer.android.com/guide/topics/wireless/bluetooth.html
Or if you'd rather (and have internet on both devices), you can use regular Socket's.
http://developer.android.com/reference/java/net/ServerSocket.html for server side
http://developer.android.com/reference/java/net/Socket.html for client side
If you have a large amount of data to transfer, internet sockets have a greater data capacity and will be faster. The other advantage is that there is no such thing as "out of range". You can connect the two devices wherever internet is available, whereas with bluetooth they have to be within bluetooth range of each other
you can use PubNub. it handles all networking and you should only care about messages.
it has great API to work.
(Thanks to #Ian Jennings : Can we send data from an android device to another android device directly (p2p) without server in the middle?)
Depends on what you are doing. If you have a server, you may be able to send some message to it and have it pulled by the other device (assuming both clients have the app installed). I think this would be the most intuitive way (but it really depends on what you are communicating).
Text messaging and email might work, but you (or the user) needs to know the numbers/emails associated with a device to do that.
you should have a look at WifiDirect
Wi-Fi peer-to-peer (P2P) allows Android 4.0 (API level 14) or later
devices with the appropriate hardware to connect directly to each
other via Wi-Fi without an intermediate access point.
As was already suggested, sockets are the easiest way to accomplish this if your devices are all connected to a network.
There are things to accomplish here:
Use Network Service Discovery to find devices running your app
Connect to other instances of your app using a socket
For a complete tutorial you can check this out
ShortAnswer: Yes
Data can be sent directly.
In order of range:
1 Bluetooth
2 wifidirect
3 maybe.. GSM hardware direct?
After that, options again in range order:
4 tether or network
5 Internet
The android NSD API is meant to do the exact same thing you are trying to achieve! The example bundled with SDK is self explanatory!
please check:
Android NSD API example

Categories

Resources