The app is designed to scan, connect, and communicate with nearby BLE devices. It showcases Flutter development skills in BLE integration, as well as UI/UX design, and follows clean architecture principles.
- Flutter: version 3.24.5
- Dart
- Flutter Blue Plus (handle ble scanning and connections)
- Geolocator (handle location services)
- Flutter Bloc (for state managment)
- Equatable
- Permission Handler
- Lottie
- BLE Device Scanning: Scans for nearby BLE devices and displays them in a list.
- Device Connection: Allows users to select and connect to a BLE device from the list.
- Data Exchange: Supports data exchange in JSON format with the connected BLE device.
- Connection Handling: Manages BLE connection states (connected, disconnected, reconnecting).
- User-Friendly Interface: Intuitive UI for easy navigation and real-time status updates.
- VS code
- Android Studio
This application was tested with the Mi Band 4, ensuring compatibility and functionality for BLE communication.
- Get the apk of the app from Drive
To get a local copy up and running, follow these instructions.
Prerequisites
- Flutter SDK: Ensure Flutter is installed on your system. Follow Flutter installation guide
- Android Studio or Visual Studio Code for development and testing.
- clone the repository
- Ensure your device's Bluetooth and Location are enabled.
- and run the app on any plugged android physical device.
Notes
- The app displays available BLE devices within range; select your BLE
device for testing.
# Clone the repository
git clone https://github.com/Mohamed-said-salah/BLE-Integration-in-a-Flutter-App.git
cd flutter_ble_integration
# Install dependencies
flutter pub get
# Run the application on an physical Android device
flutter run
# Build the APK
flutter build apk --release
.
└── lib/
├── services/
│ └── permissions.services.dart
├── features/
│ ├── services_and_permissions/
│ │ ├── data/
│ │ │ ├── repos
│ │ │ └── models
│ │ ├── views/
│ │ │ ├── screens/
│ │ │ │ ├── enable_bluetooth_screen.dart
│ │ │ │ ├── enable_location_screen.dart
│ │ │ │ ├── request_bluetooth_permissions_screen.dart
│ │ │ │ └── request_location_permissions_screen.dart
│ │ │ └── widgets/
│ │ │ └── buttons/...
│ │ └── view_models/
│ │ ├── bluetooth/
│ │ │ ├── bluetooth_status_cubit.dart
│ │ │ └── bluetooth_status_state.dart
│ │ └── location/
│ │ ├── location_status_cubit.dart
│ │ └── location_status_state.dart
│ ├── scan_near_by_devices/...
│ └── data_exchange/...
├── constants/...
└── main.dart