Coder Social home page Coder Social logo

flutter_bluetooth's Introduction

Flutter Bluetooth

Codemagic build status

NOTE: This is the updated version of the app (using flutter_bluetooth_serial 0.2.2). This version has much fewer bugs and provides a lot of functionality.

IMPORTANT NOTE [January 1, 2021]:

A much optimized and production release version of this app is available, called Connect (supports both Android and iOS devices).

Learn more about it here.

This flutter app will help you to connect to Bluetooth Devices (like, HC-05). You can send messages to the bluetooth module and perform various operations. By default, the app has only on and off functionality for any paired bluetooth devices, but you can add as many functionality as you want.

Initially, you will have to give location permission to the app. As for discovering as well as for connecting to the paired devices, location permission is required as Bluetooth transmission shares some location data.

Add this dependency in pubspec.yaml:

dependencies:
  flutter_bluetooth_serial: ^0.2.2

How to run the app

You should have flutter installed and up running properly to use this application. To check if there is any problem, use the command:

flutter doctor

Now, navigate to the project folder and run this command:

flutter run

If you get any error like this :

Then navigate to your project folder (like, flutter_bluetooth) after opening the project folder follow these steps: android -> app -> src -> main -> AndroidManifest.xml

Now, add these two lines of code :

<manifest ......
          
    <!-- this line -->
    xmlns:tools="http://schemas.android.com/tools">

    <!-- and this line -->
    <uses-sdk tools:overrideLibrary="io.github.edufolly.flutterbluetoothserial"/>
    ...
</manifest>

Screenshots

License

Copyright (c) 2019 Souvik Biswas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

flutter_bluetooth's People

Contributors

sbis04 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

flutter_bluetooth's Issues

Flutter app problem

hello

i have issue that very important

Thank you very much for answering even a part of this question

How to enable the ability to send data via Bluetooth Mobile to device in the app I created

i create app with flutter

device is a smart door in a house
and also i want to Connect with flutter experts and use their experience.

And I thought this is a good reason.

read failed, socket might closed or timeout, read ret: -1

Error occurred while connecting to a paired device.

W/BluetoothAdapter(28901): getBluetoothService() called with no BluetoothManagerCallback
E/FlutterBluePlugin(28901): read failed, socket might closed or timeout, read ret: -1
E/FlutterBluePlugin(28901): java.io.IOException: read failed, socket might closed or timeout, read ret: -1
E/FlutterBluePlugin(28901): 	at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:741)
E/FlutterBluePlugin(28901): 	at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:753)
E/FlutterBluePlugin(28901): 	at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:375)
E/FlutterBluePlugin(28901): 	at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin.lambda$connect$0(FlutterBluetoothSerialPlugin.java:235)
E/FlutterBluePlugin(28901): 	at io.github.edufolly.flutterbluetoothserial.-$$Lambda$FlutterBluetoothSerialPlugin$52C5RUgoP_r70sgAnP8ZXC1Ysz0.run(lambda)
E/FlutterBluePlugin(28901): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
E/FlutterBluePlugin(28901): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/FlutterBluePlugin(28901): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/FlutterBluePlugin(28901): 	at java.lang.Thread.run(Thread.java:760)

Flutter Doctor

[✓] Flutter (Channel stable, v1.2.1, on Linux, locale en_GB.UTF-8)
    • Flutter version 1.2.1 at /home/chandu/Flutter
    • Framework revision 8661d8aecd (3 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/chandu/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_SDK_ROOT = /home/chandu/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 33.3.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.31.1)
    • VS Code at /usr/share/code
    • Flutter extension version 2.24.0

[✓] Connected device (1 available)
    • Redmi Note 4 • 192.168.0.100:5555 • android-arm64 • Android 7.0 (API 24)

• No issues found!

Bluetooth -> BLE

Hallo...
It's first time I've found Arduino's source without library...
That's what I need for some incompatible processor.
But... About Flutter BLE and ht-10 (or other processor)?
ArduinoBLE.h doesn't work with incompatible...
Can you help?
PLEASE
PLEASE

@}-,-'-----
Gianfranco

Example code

I can't run the example code, the app keeps crash. I upgraded to flutter 1.5

iOS support

Does this also have iOS support? If not, what could I use to add iOS support?

Bluetooth disconnects when changing the page.

Friends, the example is working normally, but when entering another page the bluetooth is disconnected. When I return to the configuration page, I need to configure it again. Can anyone help me with this problem?

I am using version 0.2.2 of the serial bluetooth flutter.
I tried to set it to false in the isDisconnecting property, but it didn't work!

@OverRide
void dispose() {
// Avoid memory leak and disconnect
if (isConnected) {
isDisconnecting = false;
connection.dispose();
connection = null;
}

super.dispose();

}

I appreciate any comments!

FlutterProblem

hello

i have issue that very important

Thank you very much for answering even a part of this question

How to enable the ability to send data via Bluetooth Mobile to device in the app I created

i create app with flutter

device is a smart door in a house

and i want to control that door with my app

and also i want to Connect with flutter experts and use their experience.

And I thought this is a good reason.

Sending Variable From the buttons

Hey i was trying to make some changes to your functions and trying to implement it to send variable data to my arduino.
Can you please help with that?

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.