GithubHelp home page GithubHelp logo

nordicplayground / android-nrf-uart Goto Github PK

View Code? Open in Web Editor NEW
197.0 26.0 134.0 2.57 MB

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

Java 100.00%

android-nrf-uart's Introduction

Android-nRF-UART

This application is deprecated and no longer supported. For new app development please use nRF Blinky or nRF Toolbox which can be found on https://github.com/NordicSemiconductor/.

nRF UART app can be used to connect to Bluetooth® Smart devices running a custom Nordic Semiconductor UART service. When connected, the app can send and receive ASCII and UTF-8 text strings.

This app works with the ble_app_uart project in the nRF51 SDK and the Bluetooth Smart SDK for Arduino.

This app created as a demonstration for handling 128 bit proprietary UUID service and characteristics.

The current version is 2.0.1

This source code can be compiled with Android Studio and Gradle.

Note

  • Android 4.3 or later is required.
  • Android Studio supported

android-nrf-uart's People

Contributors

hubuhubu avatar philips77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-nrf-uart's Issues

Gradle build error with Android 23 and instant run

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'
}

Send texts longer than 20 chars

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?

bluetoothgatt discoverServices takes so long

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

Enable notification on TX characteristics after pairing

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.

i cant send cmd to device

E/UartService: mBluetoothGatt nullandroid.bluetooth.BluetoothGatt@2aa156fa
D/UartService: write TXchar - status=false
device is connected but cmd is not sending

Problem with LocalBroadcastManager

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
failedBuild

Get a Secret Bluetooth Pin from My Segway Device

Hello,
I'm connected via nRF UART v.2.0 to my Segway S PLUS in order to get the PIN code because there is no way of connecting to it via BL without the official app.
I just don't know what command to write in order to do get it or reset it. (screenshot attached)
any ideas?

PHOTO-2020-08-26-16-46-35

Scan Device Failed When Upgrade build.gradle(app)

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'

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.