Skip to content

A comprehensive cycling fitness app for Android that combines Flutter (Dart), Kotlin and SQLite database to provide an extensive cycling activity tracking experience and statistics. Integration Workshop 3 project.

License

Notifications You must be signed in to change notification settings

ViDaProjects/BeForBike_App

BeForBike Mobile Cycling App

App

A comprehensive cycling computer fitness app that combines Flutter and Kotlin to provide an extensive cycling activity tracking experience.

πŸ“‹ About the Project

This is a project developed as part of Integration Workshop 3, demonstrating the integration between Flutter (user interface) and Kotlin (background services and database). The app allows cyclists to track their activities in real-time, view detailed statistics, and analyze traveled routes.

✨ Features

πŸ“Š Activity Analysis

  • Detailed statistics: Duration, distance traveled, average/maximum speed
  • Interactive charts: Visualization of speed, cadence, power, and altitude
  • Complete history: Access to all previous activities

πŸ—ΊοΈ Route Visualization

  • Interactive map: Route visualization using OpenStreetMap
  • Elevation data: Altitude analysis along the route

πŸ”§ Technical Features

  • BLE Integration: Native Android Bluetooth LE server implementation for sensor connectivity
  • Local database: Efficient storage using SQLite on Android with statistics caching
  • Audio & Haptic Feedback: Button interaction vibration patterns
  • Seed data: Sample data for demonstration and testing
  • Platform: Android support

πŸ› οΈ Technologies Used

Frontend (Flutter)

  • State Management: Riverpod + Hooks
  • UI Components:
    • fl_chart: Interactive charts
    • syncfusion_flutter_charts: Advanced charting library
    • flutter_map: Maps with OpenStreetMap
    • google_nav_bar: Bottom navigation bar
  • Utilities:
    • geolocator: Location services
    • permission_handler: Permission management
    • shared_preferences: Local storage
    • vibration: Device vibration

Backend (Native Android)

  • Database: SQLite with Room
  • BLE: Native Android Bluetooth LE implementation
  • Services: Background processing and statistics calculations

Integration

  • MethodChannel: Flutter ↔ Android communication for database operations and BLE
  • Platform Channels: Data exchange between platforms
  • Async Operations: Background processing for performance optimization

πŸš€ How to Run

Prerequisites

  • Flutter SDK 3.38.3 or higher
  • Dart SDK 3.10.1 or higher
  • Gradle 9.2.1+
  • JDK 25+
  • Android Studio with Android SDK 36 Baklava
  • Android device or emulator

Installation

  1. Clone the repository:

    git clone https://github.com/ViDaProjects/BeForBike_App.git
    cd BeForBike_App
  2. Install dependencies:

    flutter upgrade
    flutter pub upgrade
    flutter pub get
  3. Configure Android environment:

    • Open the project in Android Studio
    • Sync Gradle
    • Configure a virtual device or connect a physical device
  4. Run the application in device:

    flutter run --debug --hot

πŸ§ͺ Running Tests

# Run all tests
flutter test

# Run tests with coverage
flutter test --coverage

# Run code analysis
flutter analyze

οΏ½πŸ“± Production Build

# Build for Android APK
flutter build apk --release

# Build for Android AAB (Google Play)
flutter build appbundle --release

πŸ“ Project Structure

bicycle-computer-app/
β”œβ”€β”€ android/                    # Native Android code
β”‚   └── app/src/main/kotlin/com/beforbike/app/
β”‚       β”œβ”€β”€ database/           # SQLite database and models
β”‚       β”œβ”€β”€ MainActivity.kt     # Android entry point and MethodChannel
β”‚       β”œβ”€β”€ BleServerService.kt # BLE GATT server implementation
β”‚       └── GattProfile.kt      # BLE service definitions
β”œβ”€β”€ lib/                        # Flutter code
β”‚   β”œβ”€β”€ core/                   # Utilities and configurations
β”‚   β”‚   └── utils/              # Audio service, color utils
β”‚   β”œβ”€β”€ data/                   # Data layer (repositories, APIs)
β”‚   β”œβ”€β”€ domain/                 # Business rules (entities, repositories)
β”‚   └── presentation/           # User interface
β”‚       β”œβ”€β”€ common/             # Shared components and widgets
β”‚       β”œβ”€β”€ home/               # Home screen and map view
β”‚       β”œβ”€β”€ my_activities/      # Activity list and details
β”‚       β”œβ”€β”€ settings/           # Settings screen
β”‚       └── statistics/         # Statistics and charts
β”œβ”€β”€ test/                       # Unit tests
└── pubspec.yaml                # Flutter dependencies

πŸ”„ Architecture

The app follows a clean architecture with clear separation of responsibilities:

  • Presentation Layer: Flutter widgets with Riverpod for state management
  • Domain Layer: Business entities and repository contracts
  • Data Layer: Repository implementations and Android communication
  • Platform Layer: Native Android code for heavy services

Data Flow

  1. Collection: BLE sensors β†’ Android SQLite database (background processing)
  2. Processing: Statistics calculations with caching on Android
  3. Presentation: Flutter reads cached data via MethodChannel
  4. Visualization: Responsive interface with interactive charts and maps

About

A comprehensive cycling fitness app for Android that combines Flutter (Dart), Kotlin and SQLite database to provide an extensive cycling activity tracking experience and statistics. Integration Workshop 3 project.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •