android-bluetooth

Can an Android device act as an iBeacon?

那年仲夏 提交于 2019-11-27 05:57:43
Can an Android device act as an iBeacon and figure out when other Android devices come in its range? Do those other Android devices need to have Bluetooth turned on? If a customer comes into my shop and he doesn't have my app installed on his device, can iBeacon work, or must he install the app first? There are so many customers are visiting our shop daily, but if they don't have my app installed, does the iBeacon concept work? UPDATE: This is now possible on Android 5.0, and you can find open-source code for transmitting as a beacon in the 2.1+ version of the Android Beacon Library . There is

Bluetooth LE Scan doesn't work on Android M in the background

99封情书 提交于 2019-11-27 02:33:45
问题 The following code works great on my Nexus 9 running Android 5.1.1 (Build LMY48M), but won't work on a Nexus 9 running Android 6.0 (Build MPA44l) List<ScanFilter> filters = new ArrayList<ScanFilter>(); ScanSettings settings = (new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_POWER)).build(); ScanFilter.Builder builder = new ScanFilter.Builder(); builder.setManufacturerData((int) 0x0118, new byte[]{(byte) 0xbe, (byte) 0xac}, new byte[]{(byte) 0xff, (byte)0xff}); ScanFilter

Solution for BLE scan's SCAN_FAILED_APPLICATION_REGISTRATION_FAILED?

主宰稳场 提交于 2019-11-27 02:16:17
问题 My Android app scans BLE devices, and from a certain point it start to fails with error code 2 ( ScanCallback.SCAN_FAILED_APPLICATION_REGISTRATION_FAILED ). I'm using Nexus 9, 5.0.1 Lollipop. This problem continued even after I relaunched the app, and when I restarted the Bluetooth service from Settings, I could finally get rid of the problem. But this problem is recurring, and I think I'm coding in a wrong way; BLE related APIs are new and there is few information. Does anyone know a general

How to find out if Android device supports Bluetooth Low Energy

早过忘川 提交于 2019-11-27 02:07:30
问题 It seems Nexus 7 first generation doesn't support Bluetooth Low Energy, at least when I follow exactly steps from tutorial http://developer.android.com/guide/topics/connectivity/bluetooth-le.html I do have app finish on following code: if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) { Toast.makeText(this, R.string.ble_not_supported, Toast.LENGTH_SHORT).show(); finish(); } Sure I checked, that Bluetooth enabled. So the question is, how to find out for sure, if

Android - Get Bluetooth UUID for this device

风流意气都作罢 提交于 2019-11-27 01:23:24
问题 I was browing Stack and the internet for a simple solution to get the UUID of the device I'm currently using. I stumbled over posts like this but none of them seemed to help me. The doc tells me about this getUuids() function but when going through the doc for Android Bluetooth I end up having a BluetoothAdapter but I need a BluetoothDevice to execute this function. So I need to know the following: 1) Is the function returning really the device UUID ? Because the name saids plural (getUuid s

Android Bluetooth Pairing without User Enter Pin and Confirmation Using Android API

五迷三道 提交于 2019-11-27 00:31:53
问题 I'm a beginner in Android programming since I only started 3 months ago. I'm doing a project which connects the android app to arduino using bluetooth. I already have a code for the android app (bluetooth.adapter,sockets,.etc.). The code for connection is already working. One of the goal is for the android app to automatically input the password when pairing with the bluetooth device without asking user to input the PIN. The old posts on this forum do not help much. (many suggested using

Connect to Bluetooth programmatically

拟墨画扇 提交于 2019-11-26 20:26:17
问题 I'm trying to connect programmatically my device to for example on my Headsets... I had KitKat version and all worked perfect ( Bluetooth always was connecting without problems autommatically) but since I've updated to Lolipop it doesn't. I'd like to know if there is any way to connect any paired device of my Android phone to Bluetooth when it turns on. Since now I've this code (gets the Device name and Device Address) because I thought with it I could connect doing something like device

Android BLE, read and write characteristics

匆匆过客 提交于 2019-11-26 19:19:24
问题 I am currently developing Android BLE, and encounters a lot of problems with the Android BLE stacks.. My development tool is Samsung Galaxy J with Android 4.3. I want to know how can I read a characteristics from the BLE and the write the characteristics (is like i verify what data I have received, and then I send another data using the BLE) and I have serious problem understanding how the Android BLE callbacks works, I dont understand these 5 functions...and the manual is not clear, can

Android Broadcast Receiver bluetooth events catching

旧巷老猫 提交于 2019-11-26 18:56:05
I'm trying to catch bluetooth state changes with Broadcast Receiver. My manifest: <uses-permission android:name="android.permission.BLUETOOTH" /> <application> <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <receiver android:name=".BluetoothBroadcastReceiver" android:label="@string/app_name"> <intent-filter> <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" /> <action android:name="android

Communicating between iOS and Android with Bluetooth LE

限于喜欢 提交于 2019-11-26 17:55:30
问题 I've got a working app using CoreBluetooth to communicate between an iPad (central) and iPhone (peripheral). I have one service that has two characteristics. I have a Nexus 7 running the latest Android 4.3 with BTLE support. Android is a bit late to jump on the BTLE bandwagon but it appears they are approaching it similarly to how iOS did, where initially they only support acting as a central with the peripheral mode coming in a later version. I can load the sample Android BTLE app and browse