nordicplayground / android-nrf-uart Goto Github PK
View Code? Open in Web Editor NEWnRF UART app for Android. A simple app showing how to handle BLE with custom service in Android.
License: BSD 3-Clause "New" or "Revised" License
nRF UART app for Android. A simple app showing how to handle BLE with custom service in Android.
License: BSD 3-Clause "New" or "Revised" License
I have updated the build tools to the latest version (30) and gradle/dependencies to 2.0.0, but I still can't run the project due to an error in the LocalBroadcastManager include/import in UartService and MainActivity. Does anyone have a solution/tip? It would be greatly appreciated!
Uploading a screenshot of the error and my idea.log if that helps :)
idea.log
At the moment it isn't possible to send more than 20 characters at once. My application requires to send longer Strings, is there some kind of buffer size which can be configured? Do i need to split the text?
from this log it shows that from mBluetoothGatt.discoverServices() to public void onServicesDiscovered(BluetoothGatt gatt, int status) callback took about 6 seconds for android 6.0.1 & 5.x. for android 4.4.2 it takes about 10 seconds, for android 4.3 about 1 second.
i like to know is there way to control / improve it ?
12:02:41.642 D/BluetoothGatt: connect() - device: F7:73:DE:00:4D:DE, auto: false
12:02:41.642 D/BluetoothGatt: registerApp()
12:02:41.642 D/BluetoothGatt: registerApp() - UUID=8a45498c-dcdf-4987-970d-0395638f72c6
12:02:41.644 D/UartService: Trying to create a new connection.
12:02:41.644 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
12:02:42.775 D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=F7:73:DE:00:4D:DE
12:02:42.775 D/UartService: onConnectionStateChange state = 2
12:02:42.777 D/UartService: broadcastUpdate 1
12:02:42.777 I/UartService: Connected to GATT server.
12:02:42.796 D/BluetoothGatt: discoverServices() - device: F7:73:DE:00:4D:DE
12:02:42.801 I/UartService: Attempting to start service discovery:true
12:02:48.298 D/BluetoothGatt: onSearchComplete() = Device=F7:73:DE:00:4D:DE Status=0
12:02:48.298 W/UartService: mBluetoothGatt = android.bluetooth.BluetoothGatt@ace296b
12:02:48.299 D/UartService: broadcastUpdate 1
12:02:48.304 D/BLE_com: ACTION_GATT_SERVICES_DISCOVERED
Please update the version of nordic UART to the latest
E/UartService: mBluetoothGatt nullandroid.bluetooth.BluetoothGatt@2aa156fa
D/UartService: write TXchar - status=false
device is connected but cmd is not sending
When updated the compilesdkversion and targetsdkversion to 28 , scan device failed.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.nordicsemi.nrfUARTv2"
minSdkVersion 18
targetSdkVersion 28
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.android.support:support-v4:23.0.0'
implementation 'android.arch.lifecycle:viewmodel:1.1.1'
}
The App is using older SDK and gradle for compiling the project which is causing build error with Android Studio using latest Android SDK.
https://github.com/NordicSemiconductor/Android-nRF-UART/blob/master/app/build.gradle
Solution
Update your Project level gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
allprojects {
repositories {
jcenter()
}
}
App level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.nordicsemi.nrfUARTv2"
minSdkVersion 18
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.0.0'
}
I discovered that on nRF-UART Android app, notifications are not enabled by default if ble-app-uart is paired without bonding. This resulted in ble-app-uart not being able to transmit data to nRF-UART as notifications were disabled. This is not a problem if pairing/bonding is disabled.
How can I enable notification on TX characteristics on nRF-UART after pairing with ble-app-uart without bonding?
Thank you.
Hi, is there any React Native plugin fit for nRF52 BLE UART app for both Android and iOS?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.