Skip to content

Commit 4625d15

Browse files
authored
Merge pull request #176 from bailuk/stage
v1.28 (42)
2 parents 6931d62 + 2a4886d commit 4625d15

File tree

391 files changed

+6707
-5073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+6707
-5073
lines changed

.github/workflows/build-on-ubuntu.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
run: ./gradlew build
2626

2727
- name: Collect files for distribution
28+
if: success() || failure()
2829
run: ci/collect-artifacts.sh
2930

3031
- name: Upload artifacts (gtk)
@@ -40,3 +41,17 @@ jobs:
4041
name: aat-android
4142
path: dist/android
4243
if-no-files-found: error
44+
45+
- name: Upload artifacts (reports)
46+
uses: actions/upload-artifact@v4
47+
if: success() || failure()
48+
with:
49+
name: reports
50+
path: dist/reports
51+
if-no-files-found: error
52+
53+
- name: Publish Test Report
54+
uses: mikepenz/action-junit-report@v5
55+
if: success() || failure()
56+
with:
57+
report_paths: '**/build/test-results/test/TEST-*.xml'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ maven-local
8686
# nix-shell
8787
/aat-android/sdk
8888
/shell.nix
89+
90+
# Kotlin
91+
.kotlin

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
See [metadata/en-US/changelogs](metadata/en-US/changelogs) for all changelogs.
4+
5+
6+
## Next

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Logo](aat-android/src/main/res/mipmap-xhdpi/ic_launcher.png)
44

5-
# AAT Another Activity Tracker
5+
# AAT Activity Tracker
66

77
AAT is a GPS-tracking application for tracking sportive activities, with emphasis on cycling.
88

aat-android/build.gradle.kts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
id("com.android.application")
3-
id("kotlin-android")
5+
id("org.jetbrains.kotlin.android")
46
}
57

68
android {
@@ -23,7 +25,7 @@ android {
2325
targetSdk = 33
2426

2527
// Version Code can not be taken from from variable (f-droid version checker fail)
26-
versionCode = 41
28+
versionCode = 42
2729
versionName = appVersionName
2830
applicationId = appId
2931
}
@@ -55,10 +57,15 @@ android {
5557
sourceCompatibility(JavaVersion.VERSION_11)
5658
targetCompatibility(JavaVersion.VERSION_11)
5759
}
58-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
59-
kotlinOptions {
60-
jvmTarget = "11"
61-
}
60+
}
61+
62+
java.sourceCompatibility = JavaVersion.VERSION_11
63+
java.targetCompatibility = JavaVersion.VERSION_11
64+
65+
66+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
67+
compilerOptions {
68+
jvmTarget.set(JvmTarget.JVM_11)
6269
}
6370
}
6471

@@ -73,7 +80,6 @@ dependencies {
7380
val focVersion: String by project
7481
implementation("com.github.bailuk.foc:foc-android:$focVersion")
7582

76-
7783
/*
7884
Automatic MapsForge integration as described here:
7985
https://github.com/mapsforge/mapsforge/raw/master/docs/Integration.md

aat-android/src/main/assets/documentation/manual.html

Lines changed: 84 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,35 @@ <h1>Getting started with the UI</h1>
22

33
<h2>Main view</h2>
44

5-
<p>When starting AAT the first time it shows the <strong>main view</strong> with a list of sub-views you can open. The first 3 entries are <strong>"Cockpit A, Cockpit B, and Map"</strong> if you have one of these open you can cycle through them with the down arrow. The right arrow switches trough the different pages of the view.</p>
5+
<p>When starting <strong>AAT-Android</strong> the first time it shows the <strong>main view</strong> with a list of sub-views you can open. </p>
6+
7+
<p>The first 3 entries are <strong>"Cockpit A, Cockpit B, and Map"</strong>. </p>
8+
9+
<p>Use the right arrow to switch trough the different pages of the view.</p>
610

711
<h2>Map view (and full screen map)</h2>
812

9-
<p><strong>Tap the edges of the map view, to get extra functionality</strong>. <br>
10-
Top edge: Cycle trough cockpit views. <br>
11-
Left edge: Edit current track or <code>draft.gpx</code>. <br>
12-
Right edge: Configure map, select grid, map search, import/export of center location. <br>
13-
Bottom edge: Zoom in and out, lock to current position, frame tracks. </p>
13+
<p><strong>Tap the edges of the map view, to get extra functionality</strong>:</p>
14+
15+
<ul>
16+
<li>Top edge: Cycle trough cockpit views.</li>
17+
<li>Left edge: Edit current track or <code>draft.gpx</code>.</li>
18+
<li>Right edge: Configure map, select grid, map search, import/export of center location.</li>
19+
<li>Bottom edge: Zoom in and out, lock to current position, frame tracks.</li>
20+
</ul>
1421

1522
<h2>Display recorded track</h2>
1623

17-
<p>Once you have stopped the tracker go back to the <strong>main view</strong> with your phones back button. Then select <strong>Track list</strong> to show a list of all recorded GPX tracks. Every track has a preview image if you tap on this image, you'll get a context menu for this GPX-file. <em>Here you can for example select this track for one of the 4 overlay slots.</em> You can display any recorded track by taping the text area of the list entry. (Always go back to the list with the phones back button). In the track view there are again different pages (graph, summary and map) and you can cycle trough all tracks with the up and down arrow.</p>
24+
<p>Once you have stopped the tracker go back to the <strong>main view</strong> with your phones back button.
25+
Then select <strong>Track list</strong> to show a list of all recorded GPX tracks. </p>
26+
27+
<p>Every track has a preview image if you tap on this image, you'll get a context menu for this GPX-file.
28+
<em>Here you can for example select this track for one of the 4 overlay slots.</em></p>
29+
30+
<p>You can display any recorded track by taping the text area of the list entry.
31+
(Always go back to the list with the phones back button). </p>
32+
33+
<p>In the track view there are again different pages (graph, summary and map) and you can cycle trough all tracks with the up and down arrow.</p>
1834

1935
<p>There are different pages in the <strong>Track list</strong> view (Access them with &lt; &#8230; > ). These pages offer <strong>a map as an alternative to the track list</strong>, <strong>summary information</strong> and <strong>filter options</strong>.</p>
2036

@@ -49,16 +65,27 @@ <h2>OpenAndroMaps step by step</h2>
4965

5066
<h1>Where to find files?</h1>
5167

52-
<p>AAT lets you create and view files in GPX format. These files are exchangeable with many other applications. They can also be edited in a text editor.
53-
These and other files are stored in subdirectories of the data directory. You can choose the location of the data directory from the settings.
54-
The structure of the data directory is as follows: </p>
68+
<p>AAT lets you create and view files in GPX format. These files are exchangeable with many other applications.
69+
They can also be edited in a text editor.
70+
These and other files are stored in subdirectories of the data directory. </p>
71+
72+
<p>Storing data in <code>/aat_data</code> is preferred by AAT. This needs special permission but makes it easier to access and share files.</p>
73+
74+
<p>With limited permission <strong>AAT-Android</strong> will store files in <code>/Android/data/ch.bailu.aat/</code> which is private space for the application and a standard on Android. This is also managed somehow by Android <em>which means that files there are getting deleted when uninstalling AAT</em>.</p>
75+
76+
<p>On <strong>AAT-GTK</strong> the location of the data directory is either <code>~/aat_data</code> or <code>~/.config/aat-gtk</code>.</p>
77+
78+
<p>You can choose any location for the data directory in the preferences: <code>Preferences-&gt;General/System/Data directory</code>.</p>
79+
80+
<p>The structure (subdirectories) of the data directory is as follows: </p>
5581

5682
<ul>
57-
<li><code>aat_data/activity[0-4]</code> - tracked activities</li>
58-
<li><code>aat_data/log</code> - activity that gets tracked at the moment</li>
59-
<li><code>aat_data/query</code> - search results from OSM-Nominatim, OSM-Overpass and offline POI </li>
60-
<li><code>aat_data/overlay</code> - GPX-files that can be used as overlays: Routes, way-points, search results&#8230;</li>
61-
<li><code>aat_data/dem3</code> - cached <a href="https://bailu.ch/dem3/">Digital elevation data files </a></li>
83+
<li><code>aat_data/activity[0-4]</code> : tracked activities</li>
84+
<li><code>aat_data/log</code> : activity that gets tracked at the moment</li>
85+
<li><code>aat_data/query</code> : search results from OSM-Nominatim, OSM-Overpass and offline POI </li>
86+
<li><code>aat_data/overlay</code> : GPX-files that can be used as overlays: Routes, way-points, search results&#8230;</li>
87+
<li><code>aat_data/dem3</code> : cached <a href="https://bailu.ch/dem3/">Digital elevation data files </a></li>
88+
<li><code>aat_data/maps</code> : alternative location for offline maps</li>
6289
</ul>
6390

6491
<h1>Calculating calories</h1>
@@ -67,25 +94,59 @@ <h1>Calculating calories</h1>
6794
MET stands for <a href="https://en.wikipedia.org/wiki/Metabolic_equivalent">metabolic equivalent</a>. The higher the value, the more energy you would use
6895
for this specific activity. A complete list of activities and MET values can be found <a href="https://sites.google.com/site/compendiumofphysicalactivities/Activity-Categories">here</a>.</p>
6996

70-
<p>Both MET and weight can be provided in the settings dialog. The MET value is leading the activity's name. For example: <code>6.8 bicycling, leisure, moderate effort</code></p>
97+
<p>Both MET and weight can be provided in the settings dialog. The MET value is leading the activity's name.
98+
For example: <code>6.8 bicycling, leisure, moderate effort</code></p>
99+
100+
<h1>AAT-Android and permissions</h1>
101+
102+
<p>Some features like <strong>GPS-tracking</strong>, accessing <strong>shared storage</strong> and accessing <strong>sensor-devices</strong> need extra permission.
103+
This needed permissions are different on different Android versions.</p>
104+
105+
<p>AAT-Android tries to aquire all those permissions on the first application start.</p>
106+
107+
<p>To acquire permissions later open <code>Preferences-&gt;General/System-&gt;App permission</code>.
108+
There you find an overview of missing permissions and a button to request permissions.</p>
109+
110+
<p>Some permissions can only be enabled manually in the Android settings: <code>App Info -&gt; Permissions -&gt; &#8230; -&gt; All permissions</code></p>
111+
112+
<p><strong>Some important permissions</strong></p>
113+
114+
<p>(Naming might be different on different Android versions)</p>
115+
116+
<ul>
117+
<li><code>Location permission (allow all the time)</code>, <code>access location in the background</code> and <code>use precise location</code>: GPS-Tracking only works if those are enabled. If tracking stops working when AAT-Android is in the background then some of these permissions are missing.</li>
118+
<li><code>Notifications (all notifications)</code>: To display tracker status in the top bar.</li>
119+
<li><code>Read heart rate</code>, <code>connect to paired BT devices</code>, <code>discover and pair nearby BT devices</code> and many more: To access BT and other sensors.</li>
120+
</ul>
121+
122+
<p><strong>Shared storage</strong></p>
123+
124+
<p>On some Android versions Storage Access Framework (SAF) is needed to access shared storage locations.
125+
SAF is token based and the token has to be renewed under some conditions like after rebooting the device.
126+
To use SAF just select <code>Pick (SAF)&#8230;</code> in the location menu found with some preferences. Example: <code>Preferences-&gt;General/System/Data directory-&gt;Pick (SAF)&#8230;</code> and then select a directory.</p>
127+
128+
<p>On other Android versions access to shared storage can be acquired by selecting <code>Preferences-&gt;General/System-&gt;App permission-&gt;Request permissions</code> and then enable <code>Allow access to manage all files</code></p>
71129

72130
<h1>Contribution</h1>
73131

74132
<h2>Issues and feedback</h2>
75133

76-
<p>For questions, feedback and bug reports <a href="https://github.com/bailuk/AAT/issues">report an issue</a> or send an e-mail to aat@bailu.ch</p>
134+
<ul>
135+
<li><a href="https://github.com/bailuk/AAT/issues">Report an issue</a></li>
136+
<li><a href="https://github.com/bailuk/AAT/discussions">Start a discussion</a></li>
137+
</ul>
77138

78139
<h2>Translation</h2>
79140

80-
<p>You can open a pull request or send me your translation as e-mail or publish them as an issue report.</p>
141+
<p>Open a pull request on GitHub to update or add translations.</p>
81142

82143
<h3>File tree structure</h3>
83144

84-
<p>Resources (like text and icons) are located in <a href="https://github.com/bailuk/AAT/blob/stage/aat-android/src/main/res">app/src/main/res</a>. </p>
85-
86-
<p>English text strings are in this file: <a href="https://github.com/bailuk/AAT/blob/stage/aat-android/src/main/res/values/strings.xml">/app/src/main/res/values/strings.xml</a></p>
87-
88-
<p>German translations are in this file: <a href="https://github.com/bailuk/AAT/blob/stage/aat-android/src/main/res/values-de/strings.xml">/app/src/main/res/values-de/strings.xml</a></p>
145+
<ul>
146+
<li>Resources (like text and icons) are located in <a href="https://github.com/bailuk/AAT/blob/stage/aat-android/src/main/res">app/src/main/res</a>. </li>
147+
<li>English text strings are in this file: <a href="https://github.com/bailuk/AAT/blob/stage/aat-android/src/main/res/values/strings.xml">/app/src/main/res/values/strings.xml</a></li>
148+
<li>German translations are in this file: <a href="https://github.com/bailuk/AAT/blob/stage/aat-android/src/main/res/values-de/strings.xml">/app/src/main/res/values-de/strings.xml</a></li>
149+
</ul>
89150

90151
<h3>Modify</h3>
91152

aat-android/src/main/kotlin/ch/bailu/aat/activities/AbsFileContentActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import ch.bailu.aat_lib.dispatcher.source.IteratorSource
2222
import ch.bailu.aat_lib.dispatcher.source.IteratorSource.FollowFile
2323
import ch.bailu.aat_lib.dispatcher.source.TrackerSource
2424
import ch.bailu.aat_lib.dispatcher.source.addOverlaySources
25+
import ch.bailu.aat_lib.dispatcher.usage.UsageTrackerAlwaysEnabled
2526
import ch.bailu.aat_lib.dispatcher.usage.UsageTrackers
2627
import ch.bailu.aat_lib.gpx.information.InfoID
2728
import ch.bailu.aat_lib.gpx.information.InformationUtil
@@ -89,14 +90,14 @@ abstract class AbsFileContentActivity : ActivityContext(), View.OnClickListener
8990
)
9091
this.fileOperation = fileOperation
9192
bar.addButton(fileOperation)
92-
bar.setOrientation(LinearLayout.HORIZONTAL)
93+
bar.orientation = LinearLayout.HORIZONTAL
9394
bar.addOnClickListener(this)
9495
}
9596

9697
protected abstract fun createLayout(bar: MainControlBar, contentView: ContentView): ViewGroup
9798

9899
private fun createDispatcher() {
99-
dispatcher.addSource(TrackerSource(serviceContext, appContext.broadcaster))
100+
dispatcher.addSource(TrackerSource(serviceContext, appContext.broadcaster, UsageTrackerAlwaysEnabled()))
100101
dispatcher.addSource(CurrentLocationSource(serviceContext, appContext.broadcaster))
101102
dispatcher.addOverlaySources(appContext, UsageTrackers().createOverlayUsageTracker(appContext.storage, *InformationUtil.getOverlayInfoIdList().toIntArray()))
102103
dispatcher.addSource(editorSource)

aat-android/src/main/kotlin/ch/bailu/aat/activities/AbsOsmApiActivity.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import android.widget.LinearLayout
66
import ch.bailu.aat.R
77
import ch.bailu.aat.menus.ResultFileMenu
88
import ch.bailu.aat.util.AppIntent
9-
import ch.bailu.aat.util.fs.TextBackup
9+
import ch.bailu.aat_lib.util.fs.TextBackup
1010
import ch.bailu.aat.util.ui.theme.AppTheme
1111
import ch.bailu.aat.util.ui.theme.UiTheme
1212
import ch.bailu.aat.util.ui.tooltip.ToolTip
@@ -31,6 +31,7 @@ abstract class AbsOsmApiActivity : ActivityContext(), View.OnClickListener {
3131
private var list: NodeListView? = null
3232
protected var configuration: OsmApiConfiguration? = null
3333
private set
34+
private var boundingBox: BoundingBoxE6 = BoundingBoxE6()
3435

3536
protected var editorView: OsmApiEditorView? = null
3637

@@ -41,7 +42,8 @@ abstract class AbsOsmApiActivity : ActivityContext(), View.OnClickListener {
4142

4243
override fun onCreate(savedInstanceState: Bundle?) {
4344
super.onCreate(savedInstanceState)
44-
configuration = createApiConfiguration(AppIntent.getBoundingBox(intent))
45+
boundingBox = AppIntent.getBoundingBox(intent)
46+
configuration = createApiConfiguration()
4547
setContentView(createContentView())
4648

4749
val configuration = configuration
@@ -110,6 +112,7 @@ abstract class AbsOsmApiActivity : ActivityContext(), View.OnClickListener {
110112
private fun createEditorView(): View {
111113
val editorView = OsmApiEditorView(
112114
this,
115+
boundingBox,
113116
configuration!!,
114117
theme
115118
)
@@ -123,7 +126,7 @@ abstract class AbsOsmApiActivity : ActivityContext(), View.OnClickListener {
123126
return bar
124127
}
125128

126-
protected abstract fun createApiConfiguration(boundingBox: BoundingBoxE6): OsmApiConfiguration
129+
protected abstract fun createApiConfiguration(): OsmApiConfiguration
127130
protected abstract fun addCustomButtons(bar: MainControlBar)
128131
override fun onClick(view: View) {
129132
if (view === download) {
@@ -138,7 +141,7 @@ abstract class AbsOsmApiActivity : ActivityContext(), View.OnClickListener {
138141
if (isTaskRunning(serviceContext)) {
139142
stopTask(serviceContext)
140143
} else {
141-
startTask(appContext)
144+
startTask(appContext, boundingBox)
142145
}
143146
}
144147
}

aat-android/src/main/kotlin/ch/bailu/aat/activities/CockpitActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class CockpitActivity : AbsKeepScreenOnActivity() {
9494

9595
private fun createDispatcher(edit: EditorSource) {
9696
dispatcher.addSource(edit)
97-
dispatcher.addSource(TrackerSource(serviceContext, appContext.broadcaster))
97+
dispatcher.addSource(TrackerSource(serviceContext, appContext.broadcaster, UsageTrackerAlwaysEnabled()))
9898
dispatcher.addSource(TrackerTimerSource(serviceContext, AndroidTimer()))
9999
dispatcher.addSource(CurrentLocationSource(serviceContext, appContext.broadcaster))
100100
dispatcher.addOverlaySources(appContext, UsageTrackers().createOverlayUsageTracker(appContext.storage, *InformationUtil.getOverlayInfoIdList().toIntArray()))

aat-android/src/main/kotlin/ch/bailu/aat/activities/CockpitSplitActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class CockpitSplitActivity : AbsKeepScreenOnActivity() {
135135

136136
private fun createDispatcher(edit: EditorSource) {
137137
dispatcher.addSource(edit)
138-
dispatcher.addSource(TrackerSource(serviceContext, appContext.broadcaster))
138+
dispatcher.addSource(TrackerSource(serviceContext, appContext.broadcaster, UsageTrackerAlwaysEnabled()))
139139
dispatcher.addSource(TrackerTimerSource(serviceContext, AndroidTimer()))
140140
dispatcher.addSource(CurrentLocationSource(serviceContext, appContext.broadcaster))
141141
dispatcher.addOverlaySources(appContext, UsageTrackers().createOverlayUsageTracker(appContext.storage, *InformationUtil.getOverlayInfoIdList().toIntArray()))

0 commit comments

Comments
 (0)