Skip to content

Commit 15350eb

Browse files
committed
fix: workflow
1 parent c4ad34b commit 15350eb

13 files changed

Lines changed: 99 additions & 821 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI & Release
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
88
release:
99
types: [created]
1010

@@ -14,47 +14,44 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v4
18-
19-
- uses: actions/setup-java@v4
20-
with:
21-
distribution: 'temurin'
22-
java-version: '25'
23-
24-
- uses: subosito/flutter-action@v2
25-
with:
26-
flutter-version: '3.35.7'
27-
channel: 'stable'
28-
29-
- name: Cache Flutter dependencies
30-
uses: actions/cache@v3
31-
with:
32-
path: |
33-
~/.pub-cache
34-
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
35-
restore-keys: |
36-
${{ runner.os }}-flutter-
37-
38-
- name: Flutter doctor
39-
run: flutter doctor
40-
41-
- name: Install dependencies
42-
run: flutter pub get
43-
44-
- name: Generate l10n
45-
run: flutter gen-l10n
46-
47-
- name: Run tests
48-
run: flutter test
49-
50-
- name: Build debug APK
51-
run: flutter build apk --debug
52-
53-
- name: Build debug appbundle
54-
run: flutter build appbundle --debug
55-
56-
- name: Upload APK
57-
uses: actions/upload-artifact@v4
58-
with:
59-
name: beforbike.apk
60-
path: build/app/outputs/flutter-apk/app-debug.apk
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-java@v4
20+
with:
21+
distribution: "temurin"
22+
java-version: "25"
23+
24+
- uses: subosito/flutter-action@v2
25+
with:
26+
flutter-version: "3.38.3"
27+
channel: "stable"
28+
29+
- name: Cache Flutter dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
~/.pub-cache
34+
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-flutter-
37+
38+
- name: Flutter doctor
39+
run: flutter doctor
40+
41+
- name: Install dependencies
42+
run: flutter pub get
43+
44+
- name: Run tests
45+
run: flutter test
46+
47+
- name: Build release APK
48+
run: flutter build apk --release
49+
50+
- name: Build release appbundle
51+
run: flutter build appbundle --release
52+
53+
- name: Upload APK
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: beforbike.apk
57+
path: build/app/outputs/flutter-apk/app-release.apk

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ migrate_working_dir/
2525
.packages
2626
.pub-cache/
2727
.pub/
28-
/build/
28+
build/
2929
pubspec.lock
3030

3131
# Symbolication related

README.md

Lines changed: 43 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Be for Bike 🚴‍♂️
1+
# BeForBike
22

33
A comprehensive cycling computer app that combines Flutter technology and native Android to provide an extensive cycling activity tracking experience.
44

@@ -21,46 +21,50 @@ This is a project developed as part of Integration Workshop 3, demonstrating the
2121
### 🗺️ Route Visualization
2222
- **Interactive map**: Route visualization using OpenStreetMap
2323
- **Elevation data**: Altitude analysis along the route
24-
- **Route export**: Ability to save and share routes
2524

2625
### 🔧 Technical Features
27-
- **BLE Integration**: Connectivity with Bluetooth sensors (speedometer, cadence meter, power meter)
28-
- **Local database**: Efficient storage using SQLite on Android
26+
- **BLE Integration**: Native Android Bluetooth LE server implementation for sensor connectivity
27+
- **Local database**: Efficient storage using SQLite on Android with statistics caching
28+
- **Audio & Haptic Feedback**: Button interaction sounds and vibration patterns
2929
- **Seed data**: Sample data for demonstration and testing
3030
- **Cross-platform**: Android support (iOS disabled in this project)
3131

3232
## 🛠️ Technologies Used
3333

3434
### Frontend (Flutter)
35-
- **Framework**: Flutter 3.35.7+
36-
- **Language**: Dart 3.9.2+
35+
- **Framework**: Flutter 3.38.3+
36+
- **Language**: Dart 3.10.1+
3737
- **State Management**: Riverpod + Hooks
3838
- **UI Components**:
3939
- `fl_chart`: Interactive charts
40+
- `syncfusion_flutter_charts`: Advanced charting library
4041
- `flutter_map`: Maps with OpenStreetMap
4142
- `google_nav_bar`: Bottom navigation bar
4243
- **Utilities**:
4344
- `geolocator`: Location services
4445
- `permission_handler`: Permission management
4546
- `shared_preferences`: Local storage
46-
- `image_picker/cropper`: Image manipulation
47+
- `audioplayers`: Audio playback
48+
- `vibration`: Device vibration
49+
- `wakelock_plus`: Screen wake lock
4750

4851
### Backend (Native Android)
49-
- **Language**: Kotlin 9.1.0+
52+
- **SDK**: Gradle 9.2.1+
5053
- **Java**: JDK 25+
5154
- **Database**: SQLite with Room
52-
- **BLE**: Bluetooth device communication
55+
- **BLE**: Native Android Bluetooth LE implementation
5356
- **Services**: Background processing and statistics calculations
5457

5558
### Integration
56-
- **MethodChannel**: Flutter ↔ Android communication
59+
- **MethodChannel**: Flutter ↔ Android communication for database operations and BLE
5760
- **Platform Channels**: Data exchange between platforms
61+
- **Async Operations**: Background processing for performance optimization
5862

5963
## 🚀 How to Run
6064

6165
### Prerequisites
62-
- Flutter SDK 3.35.7 or higher
63-
- Dart SDK 3.9.2 or higher
66+
- Flutter SDK 3.38.3 or higher
67+
- Dart SDK 3.10.1 or higher
6468
- Android Studio with Android SDK
6569
- Android device or emulator
6670
- JDK 25 or higher
@@ -69,12 +73,14 @@ This is a project developed as part of Integration Workshop 3, demonstrating the
6973

7074
1. **Clone the repository**:
7175
```bash
72-
git clone https://github.com/ViDaProjects/bicycle-computer-app.git
73-
cd bicycle-computer-app
76+
git clone https://github.com/ViDaProjects/BeForBike_App.git
77+
cd BeForBike_App
7478
```
7579

7680
2. **Install dependencies**:
7781
```bash
82+
flutter upgrade
83+
flutter pub upgrade
7884
flutter pub get
7985
```
8086

@@ -83,9 +89,9 @@ This is a project developed as part of Integration Workshop 3, demonstrating the
8389
- Sync Gradle
8490
- Configure a virtual device or connect a physical device
8591

86-
4. **Run the application**:
92+
4. **Run the application in device**:
8793
```bash
88-
flutter run
94+
flutter run --debug --hot
8995
```
9096

9197
### 🧪 Running Tests
@@ -101,37 +107,6 @@ flutter test --coverage
101107
flutter analyze
102108
```
103109

104-
### � BLE Testing
105-
106-
The project includes comprehensive BLE testing tools for validating data transmission between Windows and Android:
107-
108-
#### Prerequisites
109-
- Python 3.7 or higher
110-
- bleak library (`pip install bleak`)
111-
112-
#### Running BLE Tests
113-
114-
```bash
115-
# Simple test with 10 fixed data points
116-
python ble_test.py --simple
117-
118-
# Advanced test with realistic cycling data
119-
python ble_test.py --duration 300 --interval 1
120-
121-
# Test with compression
122-
python ble_test.py --simple --compressed
123-
124-
# Specify device MAC address
125-
python ble_test.py --simple --device AA:BB:CC:DD:EE:FF
126-
```
127-
128-
#### Test Modes
129-
- **Simple Mode**: 10 fixed data points for quick validation
130-
- **Advanced Mode**: Realistic cycling simulation with GPS, speed, cadence, and power
131-
- **Compression**: Optional GZIP compression for bandwidth testing
132-
133-
For detailed documentation, see [BLE_TEST_README.md](BLE_TEST_README.md).
134-
135110
### �📱 Production Build
136111

137112
```bash
@@ -148,21 +123,23 @@ flutter build appbundle --release
148123
bicycle-computer-app/
149124
├── android/ # Native Android code
150125
│ └── app/src/main/kotlin/com/beforbike/app/
151-
│ ├── database/ # SQLite and data models
152-
│ ├── MainActivity.kt # Android entry point
153-
│ └── BleServerService.kt # BLE service
154-
├── lib/ # Flutter code
155-
│ ├── core/ # Utilities and configurations
156-
│ ├── data/ # Data layer (repositories, APIs)
157-
│ ├── domain/ # Business rules (entities, repositories)
158-
│ ├── l10n/ # Internationalization
159-
│ └── presentation/ # User interface
160-
│ ├── common/ # Shared components
161-
│ ├── statistics/ # Statistics screen
162-
│ └── settings/ # Settings
163-
├── assets/ # Static resources
164-
├── test/ # Unit tests
165-
└── pubspec.yaml # Flutter dependencies
126+
│ ├── database/ # SQLite database and models
127+
│ ├── MainActivity.kt # Android entry point and MethodChannel
128+
│ ├── BleServerService.kt # BLE GATT server implementation
129+
│ └── GattProfile.kt # BLE service definitions
130+
├── lib/ # Flutter code
131+
│ ├── core/ # Utilities and configurations
132+
│ │ └── utils/ # Audio service, color utils
133+
│ ├── data/ # Data layer (repositories, APIs)
134+
│ ├── domain/ # Business rules (entities, repositories)
135+
│ └── presentation/ # User interface
136+
│ ├── common/ # Shared components and widgets
137+
│ ├── home/ # Home screen and map view
138+
│ ├── my_activities/ # Activity list and details
139+
│ ├── settings/ # Settings screen
140+
│ └── statistics/ # Statistics and charts
141+
├── test/ # Unit tests
142+
└── pubspec.yaml # Flutter dependencies
166143
```
167144

168145
## 🔄 Architecture
@@ -175,40 +152,7 @@ The app follows a clean architecture with clear separation of responsibilities:
175152
- **Platform Layer**: Native Android code for heavy services
176153

177154
### Data Flow
178-
1. **Collection**: BLE sensors → Android (SQLite)
179-
2. **Processing**: Statistics calculations on Android
180-
3. **Presentation**: Flutter reads data via MethodChannel
181-
4. **Visualization**: Responsive interface with charts and maps
182-
183-
## 🤝 How to Contribute
184-
185-
1. Fork the project
186-
2. Create a branch for your feature (`git checkout -b feature/AmazingFeature`)
187-
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
188-
4. Push to the branch (`git push origin feature/AmazingFeature`)
189-
5. Open a Pull Request
190-
191-
### 📝 Code Standards
192-
- Follow the [Flutter Guidelines](https://flutter.dev/docs/development/tools/formatting)
193-
- Use `flutter analyze` to check code quality
194-
- Maintain test coverage above 80%
195-
- Document new features in the README
196-
197-
## 📄 License
198-
199-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
200-
201-
## 👥 Authors
202-
203-
- **Be for Bike Team** - Initial development
204-
- **Lucas** - Maintenance and improvements
205-
206-
## 🙏 Acknowledgments
207-
208-
- Integration Workshop 3 for the opportunity
209-
- Flutter community for exceptional documentation
210-
- Android ecosystem contributors
211-
212-
---
213-
214-
**Note**: This project was developed as part of an integration workshop and serves as a technical demonstration of the possibilities of combining Flutter and native Android development.
155+
1. **Collection**: BLE sensors → Android SQLite database (background processing)
156+
2. **Processing**: Statistics calculations with caching on Android
157+
3. **Presentation**: Flutter reads cached data via MethodChannel
158+
4. **Visualization**: Responsive interface with interactive charts and maps

android/app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
plugins {
22
id "com.android.application"
3-
id "kotlin-android"
43
id "dev.flutter.flutter-gradle-plugin"
54
}
65

6+
apply plugin: 'org.jetbrains.kotlin.android'
7+
78
def localProperties = new Properties()
89
def localPropertiesFile = rootProject.file('local.properties')
910
if (localPropertiesFile.exists()) {

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
4444

4545
<application
46-
android:label="Be for Bike"
46+
android:label="BeForBike"
4747
android:name="${applicationName}"
4848
android:icon="@mipmap/launcher_icon"
4949
android:requestLegacyExternalStorage="true"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<string name="app_name">Be for Bike</string>
3+
<string name="app_name">BeForBike</string>
44
</resources>

android/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ buildscript {
66

77
dependencies {
88
classpath 'com.android.tools.build:gradle:8.13.1'
9-
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.21'
109
}
1110
}
1211

@@ -19,9 +18,7 @@ allprojects {
1918

2019
rootProject.buildDir = '../build'
2120
subprojects {
22-
project.buildDir = "${rootProject.buildDir}/${project.name}"}
23-
subprojects {
24-
project.evaluationDependsOn(':app')
21+
project.buildDir = "${rootProject.buildDir}/${project.name}"
2522
}
2623

2724
tasks.register("clean", Delete) {

0 commit comments

Comments
 (0)