https://github.com/rootcircle/beaconify
An android app to enable indoor navigation using BLE Beacons
https://github.com/rootcircle/beaconify
afc altbeacons beacons ble bluetooth positioning
Last synced: 3 months ago
JSON representation
An android app to enable indoor navigation using BLE Beacons
- Host: GitHub
- URL: https://github.com/rootcircle/beaconify
- Owner: rootCircle
- License: apache-2.0
- Created: 2024-11-11T13:29:28.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-22T17:58:24.000Z (7 months ago)
- Last Synced: 2025-04-09T23:52:10.866Z (3 months ago)
- Topics: afc, altbeacons, beacons, ble, bluetooth, positioning
- Language: Kotlin
- Homepage: https://github.com/rootCircle/BeaconifyStore
- Size: 201 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Beaconify
A **Bluetooth Low Energy (BLE)** beacon management and location tracking application built using **Kotlin** and **Jetpack Compose**. The app allows users to register and transmit virtual beacons, track their location using nearby beacons, and visualize their position on an interactive map. The app uses a **two-step approach** that leverages **Affinity Propagation Clustering (APC)** for accurate location prediction.
## Features
- **Beacon Registration & Transmission**:
- Register and transmit BLE beacons using UUID, Major, and Minor values.
- **Two-Step Location Prediction**:
- **Offline Clustering**: Collect and cluster beacon data to establish baseline reference points using APC.
- **Online Location Refinement**: Dynamically adjust user location predictions using real-time beacon data.
- **Exponential Averaging**: Smooth location predictions over time for more consistent accuracy.- **Interactive Map**:
- View real-time user location and surrounding beacon positions on a dynamic map.## Technical Workflow
### Location Prediction Process
1. **Offline Clustering**:
- Static beacons provide reference points for the initial clustering phase.
- Beacon signals are processed and grouped using **Affinity Propagation Clustering (APC)** to create initial location predictions.2. **Online Location Refinement**:
- The app continuously scans for nearby beacons and refines the user's location based on signal strength and proximity.
- **Exponential Averaging** is applied to smooth out location predictions over time, helping avoid sudden jumps or instability in the predicted position.## Help Setting Up (**Latitude and Longitude Calculation**):
To convert beacon proximity data into geographic coordinates, we use a **Modified Haversine Algorithm**. Here's an example Python implementation to demonstrate the concept:
```python
import mathdef meters_to_latlon(x, y, lat_ref, lon_ref):
# Earth's radius in meters
R = 6371000
# Convert latitude
lat = lat_ref + (y / R) * (180 / math.pi)
# Convert longitude
lon = lon_ref + (x / (R * math.cos(math.radians(lat_ref)))) * (180 / math.pi)
return lat, lon# Example usage:
lat_ref = 0 # Example reference latitude
lon_ref = 0 # Example reference longitude
x = 5.7 # 5.7 meters East
y = 9.5 # 9.5 meters Northlat, lon = meters_to_latlon(x, y, lat_ref, lon_ref)
print(f"Latitude: {lat: .6f}")
print(f"Longitude: {lon: .6f}")
```This function converts x and y (in meters) into latitude and longitude based on a reference location.
## Architecture and Technology Stack
- **Programming Language**: Kotlin
- **UI Framework**: Jetpack Compose
- **BLE Processing**: ALT Beacon format
- **Location Prediction**: Affinity Propagation Clustering (APC)
- **Backend Store**: [Beaconify Backend](https://github.com/rootCircle/BeaconifyStore)## Installation
1. Clone the repository:
```bash
git clone https://github.com/rootCircle/Beaconify.git
cd Beaconify
```2. Open the project in **Android Studio**.
3. Sync the project with Gradle dependencies.
4. Ensure your device runs **Android 8.0 (API Level 26)** or higher, with BLE support.
5. **Run the app** on a physical device.
### Important Note for Backend Setup
To fully utilize the app, you need to set up the **BeaconifyStore** backend. The app relies on this backend to store beacon data and perform location tracking functions.
#### Backend Setup
If you intend to run the app offline, make sure to have the backend set up and running. You can find the instructions for setting up **BeaconifyStore** in the **[BeaconifyStore README](https://github.com/rootCircle/BeaconifyStore)**.
Please follow the instructions in that README to get the backend ready for use with the mobile app.
## Screenshots
| Register Virtual Beacon | Beacon Transmit | Locate Yourself | Interactive Map |
|-------------------------|-----------------|-----------------|-----------------|
|  |  |  |  || Location Prediction | Permission Prompts | Homepage |
|---------------------|-------------|----------|
|  |  |  |## Usage
1. **Register a Beacon**:
- Navigate to the "Register Beacon" screen.
- Enter the beacon’s UUID, Major, and Minor values.
- Save the beacon data to the backend.
- Ensure you have at least **3 registered beacons** (or physical devices) in the network for accurate location prediction.2. **Locate Yourself**:
- Enable Bluetooth and location permissions on your device.
- Open the "Locate Me" screen to view your location on the map.
- See real-time updates of your latitude and longitude as well as nearby beacons and their locations.## Research Insights
This app uses a novel approach for beacon-based location prediction:
- **Affinity Propagation Clustering (APC)** for beacon signal grouping and location prediction.
- **Two-Step Location Prediction** to refine user location with both offline and online adjustments.
- **Exponential Averaging** for smoother, more stable location predictions over time.For a more in-depth explanation, refer to the [IEEE Paper](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8667640).
## License
This project is licensed under the [Apache-2.0 License](LICENSE).
## Contributions
Contributions are welcome! Feel free to open issues or submit pull requests.
## Acknowledgements
- [AltBeacon Library](https://altbeacon.github.io/android-beacon-library/)
- [Beaconify Backend](https://github.com/rootCircle/Beaconify)
- Research inspired by [IEEE Paper](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8667640).### Contact
For questions or feedback, please reach out to .