GithubHelp home page GithubHelp logo

joelwass / android-ble-scan-example Goto Github PK

View Code? Open in Web Editor NEW
61.0 61.0 43.0 44 KB

This is a simple example app that turns on ble and scans for devices, listing them out. It's for Android API 23

Java 100.00%
android ble scan scanner

android-ble-scan-example's Introduction

android-ble-scan-example's People

Contributors

joelwass 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-ble-scan-example's Issues

It doesn't work

This is the error reported by Android Studio
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

Failed to notify project evaluation listener.
org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 10s
ERROR: Unable to find method 'org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Device name null?

My devices are advertising the device name but I don't what the f problem with BLE it is not reading whole advertising data can you please tell me how to do it?

Android 10 needs more permissions

details: https://stackoverflow.com/questions/58428763/android-10-not-working-with-ble-bluetooth-scanning

add to manifest:

   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

You may want to change in MainActivity:

    protected void onCreate(Bundle savedInstanceState) {
        ...
        CheckPermissions(new String[] { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION,
                Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE,
                Manifest.permission.ACCESS_FINE_LOCATION,   Manifest.permission.BLUETOOTH_ADMIN});

    }

    private void CheckPermissions(String[] aPermission)
    {
        ArrayList<String> aRequest = new ArrayList<String>();
        for (int i=0; i<aPermission.length; i++)
            if (ContextCompat.checkSelfPermission(this,aPermission[i])
                    != PackageManager.PERMISSION_GRANTED)
                aRequest.add(aPermission[i]);

        if (aRequest.size() > 0)
            ActivityCompat.requestPermissions(this, aRequest.toArray(new String[0]), 1);
    }

As i am a beginner i did not care to update 
public void onRequestPermissionsResult(int requestCode,
                                       String permissions[], int[] grantResults) {

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.