Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] adding basic geolocation #13

Draft
wants to merge 101 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
bba8e40
[chore] adding geolocator dependency
Alystrasz Apr 22, 2020
3ebf22f
[chore] adding permissions for Android + iOS
Alystrasz Apr 22, 2020
d45b243
[feat] listening to location updates
Alystrasz Apr 22, 2020
b1d8b97
[refactor] now using DateTime in location entity
Alystrasz Apr 22, 2020
e58e79f
[chore] receiving one location per minute (every 61 seconds exactly)
Alystrasz Apr 23, 2020
24c6607
[chore] merge from master
Alystrasz Apr 30, 2020
f9fd978
[fix] moving location listener outside of build method
Alystrasz Apr 30, 2020
cbbcb15
[chore] merge from master
Alystrasz May 2, 2020
6770a02
[chore] merge from master
Alystrasz Jun 4, 2020
2a63c4b
[feat] adding information sheet details about geolocation
Alystrasz Jun 4, 2020
d23adaa
[feat] adding a geolocation switch in information sheet
Alystrasz Jun 4, 2020
bea5996
[refactor] exporting information sheet to new dedicated component
Alystrasz Jun 4, 2020
909c467
[refactor] switch now has a state and can be switched on/off
Alystrasz Jun 4, 2020
1e690d6
[feat] geoswitch can be triggered by touching the list tile
Alystrasz Jun 4, 2020
80d5099
[refactor] removing code duplication
Alystrasz Jun 4, 2020
0564043
[chore] adding permission_handler dependency
Alystrasz Jun 4, 2020
45c8330
[feat] switch shows state of the location permission
Alystrasz Jun 4, 2020
7a42eb5
[refactor] exporting all location list tile to dedicated component
Alystrasz Jun 4, 2020
e2ac355
[feat] displaying a message when trying to allow location
Alystrasz Jun 4, 2020
fe58852
[fix] package import was incorrect ("file:///D:/workspace/pandemia...")
Alystrasz Jun 4, 2020
10b682c
[feat] displaying a message when trying to revoke location permission
Alystrasz Jun 5, 2020
c74ce42
[feat] displaying a message when location permission has been granted…
Alystrasz Jun 5, 2020
64ae0d4
[fix] at start, the app tried to insert location while database was n…
Alystrasz Jun 5, 2020
a3d2915
[refactor] using background_locator instead of geolocator
Alystrasz Jun 8, 2020
ec7516e
[chore] removing useless imports
Alystrasz Jun 8, 2020
4f117e5
[chore] adding a custom application launcher
Alystrasz Jun 8, 2020
020eb63
[refactor] location registration is now done in the location callback
Alystrasz Jun 8, 2020
09a8c4b
[feat] geolocator can now be stopped
Alystrasz Jun 9, 2020
a18f1d3
[fix] not launching location gathering if permissions have not been g…
Alystrasz Jun 9, 2020
dec676b
[chore] updating background_locator version to 1.1.10+1
Jul 15, 2020
e2aac99
[chore] adding permission + receiver to restart location service on A…
Jul 15, 2020
7931b7f
[fix] notification icon now displays correctly
Jul 15, 2020
67f8a79
[feat] adding translations for notification
Jul 15, 2020
0125151
[fix] added french translations
Jul 15, 2020
7707aae
[fix] geolocation can be enabled on all smartphones
Jul 15, 2020
e2a37c2
[chore] attempting to add Podfile
Alystrasz Jun 8, 2020
12c887c
[fix] iOS app does not crash at start anymore
Alystrasz Jul 21, 2020
47d151f
[chore] updating iOS project scheme
Alystrasz Jul 21, 2020
29e936a
[feat] adding a human-readable message when allowing permissions in t…
Alystrasz Jul 21, 2020
929c197
[fix] adding missing iOS permissions
Alystrasz Jul 21, 2020
30b4d0c
[feat] merge from master
Alystrasz Sep 28, 2020
b15c439
[fix] adding new required parameter for BackgroundLocator.registerLoc…
Alystrasz Sep 28, 2020
173a336
[fix] adding background notification channel name
Alystrasz Sep 28, 2020
0c5772d
[fix] open database before fetching locations
Alystrasz Sep 28, 2020
c07f9d7
[feat] adding translations for location map
Alystrasz Sep 28, 2020
d4bd246
[feat] VisitedPlacesCard now have access to locations stored in database
Alystrasz Sep 28, 2020
1065f6c
[refactor] building visited places map from method
Alystrasz Sep 28, 2020
0adbc5c
[feat] Locations can be converted to LatLng
Alystrasz Sep 28, 2020
6a80469
[feat] computing heatmap if locations are stored
Alystrasz Sep 28, 2020
055514f
[refactor] VisitedPlacesCard is now stateful
Alystrasz Sep 28, 2020
efe1af6
[chore] updating Podfile
Alystrasz Sep 28, 2020
82f5e16
[refactor] building locations from database with a factory method
Sep 29, 2020
e17a058
[fix] removing useless prints
Sep 29, 2020
9d033c3
Merge branch 'master' of https://github.com/TanguyHouppe/pandemia int…
Alystrasz Mar 12, 2021
a8f65c7
Merge branch 'TanguyHouppe-master' into geolocation
Alystrasz Mar 12, 2021
c7bebaa
[fix] loading map style when building card state
Alystrasz Mar 22, 2021
2f8efa3
[refactor] removing useless code
Alystrasz Mar 22, 2021
2403b34
[refactor] computing markers in card state
Alystrasz Mar 22, 2021
3f81ccc
[fix] setting component key as final
Alystrasz Mar 22, 2021
9640f8a
Merge branch 'master' into geolocation
Alystrasz Mar 23, 2021
c77c4db
[fix] opening database before inserting locations
Alystrasz Mar 23, 2021
f519bfe
[fix] reimporting markers computation code
Alystrasz Mar 23, 2021
4e62a7b
[refactor] removing useless delay while computing exposition report
Alystrasz Mar 23, 2021
6e07956
[refactor] renaming generateRandomReport to generateReport (as it gen…
Alystrasz Mar 23, 2021
d3f195d
[fix] registering Java GeolocatorPlugin to use it while in background
Alystrasz Mar 23, 2021
7fcde0c
[fix] registering Java FlutterLocalNotificationsPlugin to send notifi…
Alystrasz Mar 23, 2021
49802ae
[refactor] removing useless imports
Alystrasz Mar 23, 2021
92473be
[chore] updating iOS dependencies
Alystrasz Mar 23, 2021
a3c67d2
[feat] registering background plugins for iOS
Alystrasz Mar 23, 2021
efcb089
[chore] adjusting iOS location settings
Alystrasz Mar 23, 2021
128c91d
[chore] using geocoding package instead of geolocator package
Alystrasz Mar 23, 2021
7374a40
[fix] updating notification icon + channel
Alystrasz Mar 24, 2021
eb2677d
[refactor] updating location tracking notification channel name
Alystrasz Mar 24, 2021
677ef8b
[feat] adding translations for exposure notification
Alystrasz Mar 24, 2021
273bce9
[refactor] passing BuildContext to geolocator for translation purposes
Alystrasz Mar 24, 2021
cf88e55
[refactor] translating location notification channel name
Alystrasz Mar 24, 2021
60ac33b
[feat] translating exposure notification
Alystrasz Mar 24, 2021
57d0ef1
[feat] setting rate to 100 if it's above 100
Alystrasz Mar 24, 2021
07000bb
[fix] adding loading text for places title
Alystrasz Mar 24, 2021
50700c8
[feat] visitedPlacesCard works with fresh locations (24h old maximum)
Alystrasz Mar 24, 2021
0963fbe
[refactor] rewriting markers method to remove useless code
Alystrasz Mar 24, 2021
a626a07
[fix] removing useless import
Alystrasz Mar 25, 2021
55daa65
[feat] adding static class to compute visited places
Alystrasz Mar 25, 2021
8ca94ff
[refactor] storing visited places in app model
Alystrasz Mar 25, 2021
9d4c751
[refactor] removing dataCollect class and transfering its method into…
Alystrasz Mar 25, 2021
9269a7a
[refactor] storing visited places markers in app model
Alystrasz Mar 25, 2021
efa366e
[fix] only initializing visitedPlacesComputer once
Alystrasz Mar 25, 2021
7f2e579
[refactor] visited places are now computed when generating report
Alystrasz Mar 25, 2021
b6e23cc
[refactor] directly getting current rate from computer while generati…
Alystrasz Mar 25, 2021
2d63255
[refactor] removing useless code
Alystrasz Mar 25, 2021
926f381
[refactor] using popular times parser to get a place's popularity
Alystrasz Mar 25, 2021
2191988
[feat] getting live popularity stats while computing visited places b…
Alystrasz Mar 25, 2021
cf8c921
[refactor] removing useless imports
Alystrasz Mar 25, 2021
19361b2
[feat] computing visited places w/ only locations captured during cur…
Alystrasz Mar 25, 2021
89dca8f
[fix] center camera on a default position when no location is available
Alystrasz Mar 26, 2021
7412382
[feat] adding method to check if phone is connected to internet
Alystrasz Mar 26, 2021
3e35fbc
[fix] preventing report refresh if there's no internet connection
Alystrasz Mar 26, 2021
b65865f
[fix] not updating exposition report at launch without internet conne…
Alystrasz Mar 26, 2021
96fce1a
[feat] displaying error message at launch when no internet
Alystrasz Mar 26, 2021
fcd4891
[fix] adding missing play services dependency
Alystrasz Mar 26, 2021
a0bfa54
build: update http dependency
Alystrasz Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
compileSdkVersion 30

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down Expand Up @@ -68,7 +68,8 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
implementation 'com.google.firebase:firebase-analytics:17.5.0'
implementation 'com.google.android.gms:play-services-basement:17.5.0'
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
Expand Down
17 changes: 13 additions & 4 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

<application
android:name="io.flutter.app.FlutterApplication"
android:label="pandemia"
android:name=".Application"
android:label="Pandemia"
android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDuaGx_aNhUjq99-4brKJqYOCTEC36sPr4"/>
Expand All @@ -23,8 +28,12 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->

<service android:name="rekab.app.background_locator.IsolateHolderService"
android:permission="android.permission.FOREGROUND_SERVICE"
android:exported="true"
android:foregroundServiceType = "location"/>

<meta-data
android:name="flutterEmbedding"
android:value="2" />
Expand Down
29 changes: 29 additions & 0 deletions android/app/src/main/kotlin/fr/inria/pandemia/Application.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package fr.inria.pandemia

import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.view.FlutterMain
import rekab.app.background_locator.IsolateHolderService
import com.tekartik.sqflite.SqflitePlugin
import com.baseflow.geocoding.GeocodingPlugin
import com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin

class Application : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
IsolateHolderService.setPluginRegistrant(this)
FlutterMain.startInitialization(this)
}

override fun registerWith(registry: PluginRegistry?) {
if (!registry!!.hasPlugin("com.tekartik.sqflite")) {
SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite"))
}
if (!registry!!.hasPlugin("com.baseflow.geocoding")) {
GeocodingPlugin.registerWith(registry.registrarFor("com.baseflow.geocoding"))
}
if (!registry!!.hasPlugin("com.dexterous.flutterlocalnotifications")) {
FlutterLocalNotificationsPlugin.registerWith(registry.registrarFor("com.dexterous.flutterlocalnotifications"))
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion assets/flutter_i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"home_info_data_title": "Personal data",
"home_info_data_text1": "Pandemia is a standalone application; it does not send your data to third parties",
"home_info_data_text2": "If you activate your smartphone's geolocation, we use locations to improve our calculations' results; these locations are stored on your smartphone, and nowhere else.",
"home_info_location_title": "Location",
"home_info_location_text": "If you activate your smartphone's geolocation, we use locations to improve our calculations' results.",
"home_info_location_permanentlydenied": "You permanently denied location permission to Pandemia; to fix it, update the app settings.",
"home_info_location_removepermission": "Location permission needs to be revoked in the app settings.",
"home_info_disclaimer_title": "Disclaimer",
"home_info_disclaimer_text": "Pandemia-computed information does not replace screening tests, but can help you decide whether to be tested by health services.",
"home_info_source_title": "Source code",
Expand All @@ -28,6 +32,7 @@
"home_ratemsg_stayhome": "I certainly have been exposed today, I must stay home",

"word_place": "place",
"word_location": "location",

"places_searchbar_label": "Search place...",
"places_place_added_toast": "Place added to favorites.",
Expand Down Expand Up @@ -158,5 +163,18 @@
"day_4": "Thursday",
"day_5": "Friday",
"day_6": "Saturday",
"day_7": "Sunday"
"day_7": "Sunday",

"location_service_disabled": "Geolocation has been activated but the location service is not running; please enable it in your smartphone's settings.",
"location_notification_channel_name": "Location tracking",
"location_notification_title": "Registering locations",
"location_notification_text": "Tap to check your virus exposition.",

"exposition_notification_title": "High exposure rate",
"exposition_notification_text": "Your daily exposure rate is",
"exposition_notification_channel_name": "Exposition alerts",
"exposition_notification_channel_description": "This channel sends alerts regarding virus exposition.",

"no_internet_connection": "No internet connection.",
"no_internet_no_report_message": "Exposition report hasn't been computed because your phone is not connected to the Internet."
}
20 changes: 19 additions & 1 deletion assets/flutter_i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"home_info_data_title": "Vos données personnelles",
"home_info_data_text1": "Pandemia est une application fonctionnant en autonomie ; elle ne transmet pas vos informations à un quelconque tiers.",
"home_info_data_text2": "Si vous activez la géolocalisation de votre smartphone, nous utilisons les positions remontées par celui-ci pour améliorer les résultats de nos calculs ; ces positions sont stockées sur votre smartphone, et n'en sortent pas.",
"home_info_location_title": "Géolocalisation",
"home_info_location_text": "Si vous activez la géolocalisation de votre smartphone, nous utilisons les positions remontées par celui-ci pour améliorer les résultats de nos calculs.",
"home_info_location_permanentlydenied": "Vous avez refusé de façon permanente la géolocalisation à Pandemia; vous pouvez cependant accorder cette permission dans les paramètres de votre téléphone.",
"home_info_location_removepermission": "Cette permission doit être retirée dans les paramètres du téléphone.",
"home_info_disclaimer_title": "Avertissement",
"home_info_disclaimer_text": "Les informations calculées par Pandemia ne remplacent en aucun cas un test de dépistage, mais elles peuvent contribuer à identifier la nécessité de se faire dépister auprès de professionnels de santé.",
"home_info_source_title": "Sources",
Expand All @@ -28,6 +32,7 @@
"home_ratemsg_stayhome": "J'ai été exposé à coup sûr aujourd'hui, je dois rester chez moi",

"word_place": "endroit",
"word_location": "position",

"places_searchbar_label": "Rechercher un endroit...",
"places_place_added_toast": "Endroit ajouté aux favoris.",
Expand Down Expand Up @@ -158,5 +163,18 @@
"day_4": "Jeudi",
"day_5": "Vendredi",
"day_6": "Samedi",
"day_7": "Dimanche"
"day_7": "Dimanche",

"location_service_disabled": "La géolocalisation est activée, mais pas le service associé ; merci de l'activer dans les paramètres de votre smartphone.",
"location_notification_channel_name": "Ecoute des positions",
"location_notification_title": "Enregistrement des positions",
"location_notification_text": "Toucher pour ouvrir l'application.",

"exposition_notification_title": "Taux d'exposition élevé",
"exposition_notification_text": "Votre taux d'exposition quotidien est de",
"exposition_notification_channel_name": "Alertes d'exposition",
"exposition_notification_channel_description": "Ce canal transmet des alertes pour vous prévenir d'une exposition au virus.",

"no_internet_connection": "Pas de connexion internet.",
"no_internet_no_report_message": "Le calcul d'exposition au virus n'a pas pu aboutir car votre téléphone n'est pas connecté à Internet."
}
2 changes: 1 addition & 1 deletion ios/Flutter/.last_build_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4e08ed344469a701460ef485362d0864
b29e012282dcf317e1b6fdc639d1ff17
Loading
Loading