Do turning bluetooth on with Android makes it a beacon? - android

if i turn on bluetooth in iOS it will be discovered in beacon scanner, is it the same with Android?
Or we should turn the android to be a beacon explicitly using any libraries like alt beacon?
What am trying to achieve is to get RSSI from android by ONLY enabling Bluetooth.

No. Turning on bluetooth does not make mobile devices -- neither Android nor iOS -- advertise as beacons. If you want to make either platform advertise as a beacon, you must install a custom app that is programmed to start the advertising. The Android Beacon Library has tools to do this on Android. On iOS you can use built-in CoreLocation and CoreBluetooth.
On both iOS and Android, if you turn on Bluetooth from the settings screen and leave the settings screen up, it will emit both BLE and Bluetooth Classic packets to make it discoverable by external bluetooth scanning apps. But these advertisements will absolutely not be BLE Beacon advertisements in the strict sense. It is still possible to detect these non-beacon packets with some scanning apps.
Just enabling bluetooth on either platform might make it detectable based on what the other apps are doing. There may be pre-existing apps on the phones that emit BLE beacon advertisements, BLE GATT service advertisements, or similar. However, you cannot predict whether any individual device will do this because you can't predict what apps are installed. Nor can you know what advertisements random apps will emit in a way that is predictable. If you want to be able to rely on detecting another device with BLE in a predictable way you must get an app installed on that device.

Related

Bluetooth BLE Implementation

I'm trying to implement a Bluetooth (BLE) gateway into a project to transfer data between hardware and a mobile device with an application. The hardware is not unique, it could be mass produced with the controller having the same program flashed into it.
If 100 of the hardware product is made, powered up sitting side by side, what is the best way to set up the information that the BLE broadcasts to advertise so that it can be received by a mobile device, and only 1 hardware and mobile device can be connected at any time.
For example, if you have 3 of the same fitness tracking watches side by side, and you only want to connect to 1 of them, how do you distinguish which is which on say the phones bluetooth pairing menu.
Does each of the manufactured hardware need to have a unique ID that shows on the mobile device (eg ABC11, ABC112, ABC113 etc), and how do you program 100 unique programs into the hardware quickly.
On the other hand, should each of the hardware have the same ID broadcast, and then the user just hopes for the best if the correct hardware is paired.
(BTW, the hardware is an arduino based microcontroller using a BM70 BLE module. neither of which are intended to be modified by the user)
Assistance appreciated.
Thanks. Nunya
You do not have to manually program a different MAC addresses for each device, the BM70 module is the one that provides the BLE MAC address and they are supposed to have unique ones. Sometimes manufacturer recycle (reuse) the addresses, but I think the chance to hit a MAC twice with 100 devies is pretty low.
If your devices are all the same and use the same program they all offer and advertise the same BLE service. The service and containing characteristics are the feature that distinguishes your devices from other BLE devices. A true BLE device that does not also use Bluetooth Classic will not show up in your phones bluetooth settings or pairing menu. BLE requires a dedicated app where you scan for BLE devices and idealy filter for the special service you are using to only find your own devices.
To distinguish between 100 devices placed next to each other (if this even matters since they are all the same) you need to either read the MAC address and prit it on a label for each device or use some status LEDs to show the connection status on your arduino. If you connect to one device the LEDs could start blinking to show which device you are connected to.

Building a Bluetooth 4.0 messenger using Android

I'm trying to build a messenger that requires no bluetooth pairing. The message will be broadcast by the user who adds it and can be received by the listeners in the neighborhood.
I have read in several places that Bluetooth 4.0 has support for this. However most examples involve reading from a ibeacon or a similar device.
Can I use Bluetooth 4.0 to build both a broadcaster and a receiver android app?
I thought of leaving this here because it might be helpful for someone else.
Bluetooth 4.0 broadcast mode requires special hardware and it's only present in a few mobile devices. (Bluetooth peripheral mode) Therefore, instead of using bluetooth low energy, I used SDP (Service Discovery Protocol). The messages are limited to 13 characters.
However due to security restrictions, the app doesn't work for platforms above Jellybean.
Here's my development work. https://github.com/malithj/Seeder

Bluetooth proximity scan while paired

I have been doing a ton of research on this project I want to do, probably read every SO post (bluejacking, RFCOMM, beacons, etc...) and my head is spinning.
I want to create a system at home, using Arduino (with bluetooth le) that will scan bluetooth and detect when my phone or any of my family members phones are in proximity. Whether this is a MAC scanner or simply getting the friendly name. I would also like to get the RSSI. I dont need to do accurate distance measurement but I would like to know approximately how close they are. Does anybody have any suggestions for this approach? I know I can create an app on the phone and have it become a beacon and this may be an option but I am concerned with Android, it would have to be Marshmallow 5.0 at a minimum. I would like support to be a little lower than that, like JB or KK. So, it seems like there should be a simple scan, just looking for the MAC or name. That is all I really need.
That said, the main question I have is, can you scan for and see bluetooth devices in range if they are already paired to something? Like a Bluetooth headset? I understand bluetooth is point to point but does it allow multiple connections or at least broadcast the mac or name when paired?
This question, along with any general suggestions will help me out tremendously!
Thanks!
Bluetooth Discovery from the Listener involves Listening for Bluetooth Inquiry packets(RX) and inquiry response (TX).if done continuously this will deplete the battery. Hence most devices (including Mobile Phones and Headsets) has a policy of when to be discover-able and connectable. Headsets in particular are discoverable only when they are instructed and connectable until one device is connected to it ( There are probably exceptions where the headset has the capability to be connected to multiple phones at the same time). Most Mobile Phones are discoverable only when they are in settings screen ( Android,IOS and Windows Phones), but unlike the headset case they are connectable.
so one option with the MobilePhone is to see if it is possible to connect to them after pairing once ( for example by trying a service search on the remote device and see if it returns the service attributes, this internally makes a connection and indirectly ensures the presence of the device).
if you are specific about a mobile phone which is already paired then you might need to establish a higherlayer connection ( such as SPP) with Authentication and encryption. This would force a two way check between devices to see whether they are already paired. other less secure option is to rely on the Phone (Android and IOS phones doesn't generally Allow a higher layer connection without encryption/pairing) and try to establish an SPP connection to the phone.
Another option is to use Bluetooth-LowEnergy. But Note that security in BT was superior to BLE till BTv4.1 and same on BTv4.2.

Can I transmit a beacon signal from my android device while at the same time scanning nearby beacons?

Is it possible to transmit and receive beacon signals at the same time using an android device acting as a beacon?
Yes, on Android 5+ devices that support beacon transmission (see the list here), you can both send and receive beacon transmissions simultaneously. You can see a demonstration of this using the Android Locate app. Simply turn on a transmitter, then switch to locating beacons. If you do this on two Android phones at the same time, they will both see eachother's transmission.
A few things to be aware of:
An mobile device will not detect its own transmission.
Android 4.3-4.4.x devices can receive beacon transmissions but cannot transmit. (Some older Android 4.x devices do not have Bluetooth LE and cannot receive at all.)
Some Android 5.x+ devices do not have firmware that supports transmission. Check the list above to make sure your device supports it.

Is it possible to scan with an Android/ios device for other Android/ios devices' UUIDs or mac addresses in the background via Bluetooth LE?

I'm not a developer but I'm curious about the connectivity options between smartphones.
Looks like BLE is the only technology that is available on both Android and ios that could make an connection possible in the foreground, but is able to scan in the background?
If I walked around with my phone in the pocket, could it scan in intervalls for other devices`UUIDs/mac addresses and save the data realibly without the process being shut down after a while?
the app would have to work between Android phones, ios Devices,
and Android phones-ios Devices.
I dont want a stable connection. I'm only speaking about gathering UUIDs and mac adresses in the background. whichever is more suitable to uniquely identify a device.
Thanks in advance.
iOS devices with BLE support can act as the peripheral and/or the central role. The peripheral advertises its services, and the central discovers them (via scanning). You need Android 5.0+ to support peripheral mode.
Once a central discovers a peripheral, the central can obtain advertisement details from it, including a unique peripheral ID. This is similar to a MAC address, though some peripherals randomly generate these IDs.
In general, an iOS or Android device acts in the central role and it doesn't advertise anything. There is nothing to discover. However, you could write an app that acts as both a peripheral and a central.
On iOS, your app can perform both BLE roles in the background (your app doesn't need to be in the foreground).
You would want to do background tasks responsibly as both advertising and scanning require the radio, which uses a significant amount of power (drains the battery).
There are many issues with the current BLE stack on Android (e.g. using WIFI and BLE at the same time because they share the radio). The BLE API first became available for Android with 4.2.
The iPhone 4s and later has BLE with the API first available in iOS 6.

Categories

Resources