A native Android application that transforms any phone into a Bluetooth Low Energy (BLE) Peripheral, simulating a smart logistics sensor. It broadcasts real-world cold chain & supply chain data over BLE β no physical sensor hardware required.
This is the mobile companion to the PC-based BLE Sensor Simulator (Node.js/bleno). Both simulators share identical UUIDs, payload formats, and BLE protocol behavior, making them fully interchangeable.
The app acts as a BLE GATT Server (Peripheral) that:
- π Loads 1,000 rows of logistics sensor data from a bundled CSV dataset
- π» Advertises as
LogisticsSimover Bluetooth Low Energy - π Cycles through data rows every 2 seconds
- π€ Broadcasts each row as a UTF-8 string via Read and Notify characteristics
- π Displays a real-time dashboard with live payload, sensor values, and event log
A separate device (phone, tablet, or PC) running a BLE client/scanner can discover, connect, and receive the streaming data.
ββββββββββββββββββββββββββββββββββββββββ
β π BLE Sensor Simulator β
β Logistics & Cold Chain β
β β
β ββ SERVICE STATUS βββββββββββββββββ β
β β π’ Advertising... Waiting β β
β β No connections β β
β ββββββββββββββββββββββββββββββββββββ β
β β
β ββ BLE CONFIGURATION βββββββββββββ β
β β Device Name: LogisticsSim β β
β β Service: A07498CA-AD5B-... β β
β β Char: 51FF12BB-3ED8-... β β
β β Properties: Read | Notify β β
β β Interval: 2000ms β β
β ββββββββββββββββββββββββββββββββββββ β
β β
β ββ CURRENT DATA ββββ Row: 42/1000 β β
β β BLE Payload: β β
β β ββββββββββββββββββββββββββββββββ β β
β β β Truck_7,27.0,67.8,Delayed β β β
β β ββββββββββββββββββββββββββββββββ β β
β β π Truck_7 π¦ Delayed β β
β β π‘οΈ 27.0Β°C π§ 67.8% β β
β ββββββββββββββββββββββββββββββββββββ β
β β
β ββ EVENT LOG ββββββββββββββββββββββ β
β β [15:30:01] Simulator started β β
β β [15:30:01] Advertising... β β
β β [15:30:05] Device connected β β
β β [15:30:05] Client subscribed β β
β β [15:30:07] Broadcasting: ... β β
β ββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββ β
β β βΉ STOP SIMULATOR β β
β ββββββββββββββββββββββββββββββββββββ β
β β
β Dataset: sensor_data.csv (1000) β
ββββββββββββββββββββββββββββββββββββββββ
This app implements the exact same BLE protocol as the PC simulator:
| Parameter | Value |
|---|---|
| Advertising Name | LogisticsSim |
| Service UUID | A07498CA-AD5B-474E-940D-16F1FBE7E8CD |
| Characteristic UUID | 51FF12BB-3ED8-46E5-B4F9-D64E2FEC021B |
| CCCD (Descriptor) | 00002902-0000-1000-8000-00805f9b34fb |
| Properties | Read, Notify |
| Encoding | UTF-8 String |
| Update Interval | 2000ms |
| Payload Format | AssetID,Temperature,Humidity,ShipmentStatus |
Truck_7,27.0,67.8,Delayed
Truck_6,22.5,54.3,In Transit
Truck_10,25.2,62.2,In Transit
Truck_9,25.4,52.3,Delivered
| Component | Technology |
|---|---|
| Language | Kotlin 1.9.24 |
| Min SDK | 26 (Android 8.0 Oreo) |
| Target SDK | 35 (Android 15) |
| Build System | Gradle 8.9 + AGP 8.7.3 |
| Java | OpenJDK 17 |
| BLE Stack | Android BluetoothLeAdvertiser + BluetoothGattServer |
| UI | Material Components + ViewBinding |
| Service | Foreground Service (connectedDevice type) |
| Architecture | Service β BroadcastReceiver β Activity |
- Transfer
BLE-Sensor-Simulator.apkto your Android phone - Enable "Install from Unknown Sources" in Settings
- Open the APK and install
Prerequisites:
- Android SDK (API 35)
- Java 17+
- Bluetooth 4.0+ device with BLE Peripheral support
# Clone the repository
git clone https://github.com/TruGanic/ble-native-simulator.git
cd ble-native-simulator
# Build the debug APK
./gradlew assembleDebug
# Install via ADB
adb install app/build/outputs/apk/debug/app-debug.apk- Open BLE Sensor Simulator on your Android phone
- Grant Bluetooth and Notification permissions when prompted
- Tap βΆ START SIMULATOR
- The status will show "Advertising... Waiting for connections"
On a separate device, use any BLE client:
| Client | Platform |
|---|---|
| nRF Connect | Android / iOS |
| BLE Scanner | Android |
| LightBlue | iOS |
| Your React Native / Flutter app | Any |
PC with noble / bleak |
Linux / macOS / Windows |
Steps:
- Scan for BLE devices
- Connect to "LogisticsSim"
- Find Service
A07498CA-... - Open Characteristic
51FF12BB-... - Enable Notifications (or do a Read)
- Data streams every 2 seconds β
β οΈ Important: The simulator and scanner must run on separate physical devices. A single phone cannot be both the BLE Peripheral and Central simultaneously for the same service.
The bundled sensor_data.csv contains 1,000 rows of simulated logistics & cold chain data.
Source: Smart Logistics Supply Chain Dataset by ziya07 on Kaggle.
| Field | Example | Used in BLE Payload |
|---|---|---|
| Timestamp | 2024-03-20 00:11:14 |
|
| Asset_ID | Truck_7 |
β |
| Latitude | -65.7383 |
|
| Longitude | 11.2497 |
|
| Inventory_Level | 390 |
|
| Shipment_Status | Delayed |
β |
| Temperature | 27.0 |
β |
| Humidity | 67.8 |
β |
| Traffic_Status | Detour |
|
| Waiting_Time | 38 |
|
| + 6 more fields | ... |
ble-native-simulator/
βββ app/
β βββ build.gradle.kts # App-level build config
β βββ proguard-rules.pro
β βββ src/main/
β βββ AndroidManifest.xml # Permissions & service declaration
β βββ assets/
β β βββ sensor_data.csv # Bundled dataset (1000 rows)
β βββ java/com/truganic/blesimulator/
β β βββ MainActivity.kt # UI controller, permissions, lifecycle
β β βββ BleSimulatorService.kt # Core BLE peripheral (GATT server)
β β βββ CsvDataManager.kt # CSV parser & row cycling
β β βββ LogisticsData.kt # Data model & payload serializer
β βββ res/
β βββ layout/activity_main.xml # Dark-themed dashboard layout
β βββ drawable/ # Status indicators, backgrounds
β βββ values/ # Colors, strings, themes
βββ build.gradle.kts # Root build config
βββ settings.gradle.kts # Project settings
βββ gradle.properties # Gradle JVM & Android config
βββ gradlew # Gradle wrapper script
βββ gradle/wrapper/
β βββ gradle-wrapper.properties # Gradle 8.9 distribution
βββ sensor_data.csv # Source dataset
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Android Phone (Peripheral) β
β β
β ββββββββββββ ββββββββββββββββββββ βββββββββββββββββββββ β
β β CSV βββββΆβ CsvDataManager βββββΆβ BleSimulator β β
β β Asset β β Parse & Cycle β β Service β β
β β Data β β Every 2 sec β β β β
β ββββββββββββ ββββββββββββββββββββ β βββββββββββββββ β β
β β β GATT Server β β β
β β β Advertiser ββββΌβββΌβββΆ BLE Radio
β β βββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββ β β β
β β MainActivity βββββ Broadcasts β β
β β Live Dashboard + Event Log β βββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
BLE Radio Wave
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Another Device (Central / Scanner) β
β β
β nRF Connect / React Native App / Python bleak / etc. β
β βββΆ Scan βββΆ Connect βββΆ Subscribe βββΆ Receive Data β
β β
β Payload: "Truck_7,27.0,67.8,Delayed" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Both simulators are protocol-compatible and interchangeable:
| Feature | PC Simulator | Android Simulator |
|---|---|---|
| Language | TypeScript / Node.js | Kotlin |
| BLE Library | @abandonware/bleno |
Android BLE API |
| Platform | Linux (BlueZ) | Android 8.0+ |
| Service UUID | β Identical | β Identical |
| Characteristic UUID | β Identical | β Identical |
| Payload Format | β Identical | β Identical |
| Update Interval | 2000ms | 2000ms |
| Advertising Name | LogisticsSim | LogisticsSim |
| Requires Root | Yes (sudo) |
No |
| Portable | β Desktop/RPi only | β Any Android phone |
- Android 8.0 Oreo (API 26) or higher
- Bluetooth 4.0+ with BLE Peripheral mode support
- Most phones manufactured after 2015 support this
- Android 12 (API 31)
- Android 13 (API 33)
- Android 14 (API 34)
| Permission | Purpose | Android Version |
|---|---|---|
BLUETOOTH_ADVERTISE |
BLE advertising | 12+ (API 31+) |
BLUETOOTH_CONNECT |
GATT server connections | 12+ (API 31+) |
BLUETOOTH |
Legacy BLE access | β€11 (API β€30) |
BLUETOOTH_ADMIN |
Legacy BLE admin | β€11 (API β€30) |
ACCESS_FINE_LOCATION |
Legacy BLE scanning | β€11 (API β€30) |
FOREGROUND_SERVICE |
Keep service alive | 9+ (API 28+) |
POST_NOTIFICATIONS |
Service notification | 13+ (API 33+) |
ISC
- Dataset: Smart Logistics Supply Chain Dataset by ziya07
- PC Simulator: TruGanic/ble-sensor-simulator
- BLE Protocol Design: Based on the Bluetooth SIG GATT specification
Built with β€οΈ by TruGanic