Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c40b496
Update project configuration, dependencies and permissions
lidong-guo Feb 10, 2026
e8b04af
Implement updated sensor data collection (BLE/WiFi) and API integration
lidong-guo Feb 10, 2026
6a5a8e4
Add indoor map display features and update user interface
lidong-guo Feb 10, 2026
40866dd
Finalize application features and tests
lidong-guo Feb 10, 2026
7447bc4
Fix imports and remove redundant Traj class
lidong-guo Feb 10, 2026
32660ac
Fix manifest placeholders and build configuration
lidong-guo Feb 10, 2026
ae82b5f
Refine code comments and documentation
lidong-guo Feb 10, 2026
2134aac
Update MainActivity and ServerCommunications
lidong-guo Feb 10, 2026
886dc3b
Update /ReplayFragmen
lidong-guo Feb 10, 2026
9500267
Fix ReplayFragment logic crash and SensorFusion start location logic
lidong-guo Feb 10, 2026
84bc3f9
feat(pdr): optimize step length parameters and update core sensor fus…
lidong-guo Mar 31, 2026
98dfd6d
feat(algorithm): integrate Madgwick AHRS and magnetic grid assets
lidong-guo Mar 31, 2026
8a07e63
feat(pdr): optimize step length parameters and update core sensor fus…
lidong-guo Mar 31, 2026
8c6fd7f
chore: code repair and maintenance
lidong-guo Mar 31, 2026
64d22c3
fix(replay): partial repair and replay upgrade for WiFi trajectory vi…
lidong-guo Mar 31, 2026
7f00ac7
fix: repair and optimize sensor fusion algorithms, map rendering, and…
lidong-guo Mar 31, 2026
ec11cc3
refactor: structural optimization and maintenance across presentation…
lidong-guo Mar 31, 2026
cdf8dfc
fix: final maintenance for test classes
lidong-guo Apr 1, 2026
a9a598d
Update secrets.properties with placeholder keys
lidong-guo Apr 1, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.cxx
local.properties
/.idea/
secrets.properties
53 changes: 27 additions & 26 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ plugins {
id 'com.google.gms.google-services'
id 'androidx.navigation.safeargs'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
id 'com.google.protobuf' version '0.9.4'
}

// (Optional) load local secrets file:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('secrets.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -14,18 +14,19 @@ if (localPropertiesFile.exists()) {

android {
namespace "com.openpositioning.PositionMe"
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.openpositioning.PositionMe"
minSdk 28
targetSdk 34
targetSdk 35
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// Example of referencing secrets (if you use secrets.properties):
manifestPlaceholders = [MAPS_API_KEY: localProperties['MAPS_API_KEY'] ?: ""]

buildConfigField "String", "MAPS_API_KEY",
"\"${localProperties['MAPS_API_KEY'] ?: ''}\""
buildConfigField "String", "OPENPOSITIONING_API_KEY",
Expand All @@ -34,12 +35,6 @@ android {
"\"${localProperties['OPENPOSITIONING_MASTER_KEY'] ?: ''}\""
}

buildFeatures {
// For example:
// compose true // if you want Jetpack Compose
// viewBinding true
}

buildFeatures {
buildConfig true
}
Expand All @@ -57,39 +52,45 @@ android {
}
}

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.25.3'
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
}
}
}
}
}

dependencies {
// Core AndroidX
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // or stable: 1.6.1
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'androidx.gridlayout:gridlayout:1.0.0'

// Material Components (Material 3 support is in 1.12.0+)
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
implementation 'com.google.android.material:material:1.12.0'

implementation 'com.google.protobuf:protobuf-java:3.0.0'
implementation 'com.google.protobuf:protobuf-java:3.25.3'
implementation "com.google.protobuf:protobuf-java-util:3.25.3"

implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation "com.google.protobuf:protobuf-java-util:3.0.0"
implementation "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava"
implementation 'com.google.android.gms:play-services-maps:19.0.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'androidx.biometric:biometric:1.2.0-alpha04'

// Navigation components
def nav_version = "2.8.6"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"

// Optional: Jetpack Compose (Material 3)
// implementation "androidx.compose.material3:material3:1.3.1"
// implementation "androidx.activity:activity-compose:1.7.2"

// Testing
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
// Instrumented test, which will execute on an Android device.
// @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
Expand All @@ -23,4 +20,5 @@ public void useAppContext() {
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.openpositioning.PositionMe", appContext.getPackageName());
}
}
}

114 changes: 44 additions & 70 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,102 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.openpositioning.PositionMe">
xmlns:tools="http://schemas.android.com/tools"
>

<!--
1. Hardware features.
If you truly require these sensors, keep `required="true"`. Otherwise,
consider marking them as `required="false"`.
-->
<uses-feature android:name="android.hardware.sensor.stepdetector" android:required="true"/>
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true"/>
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="true"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
<uses-feature android:name="android.hardware.wifi.rtt" android:required="false"/>

<!--
2. Permissions.
a) For Android 10 and above, if your app needs to do background location,
you should also add:
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
b) If you want to continue reading/writing files outside of your
app-specific directory, you must set `requestLegacyExternalStorage="true"`.
(See the <application> tag below.)
-->

<!-- Wake lock -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

<!-- Physical activity / Step detection (Android 10+ requires runtime permission) -->
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>

<!-- Wi-Fi and network state (note that setWifiEnabled() no longer works on Android 10+ if you target 29+) -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<!-- Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<!-- Internet -->
<uses-permission android:name="android.permission.INTERNET"/>

<!-- Storage - Deprecated in Android 10+ (use scoped storage instead)
If you plan to adopt scoped storage fully and store only within your app-specific directories
(or MediaStore for shared media), consider removing READ/WRITE_EXTERNAL_STORAGE eventually.
If you still need broad file access (for example, to migrate existing user data), keep them
short-term but note that starting with Android 11 (API 30), they don’t allow the same broad file access.
-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- Required if your app needs to access images or photos that other apps created. -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<!-- Required if your app needs to access videos that other apps created. -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />

<!-- Required if your app needs to access audio files that other apps created. -->
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

<uses-permission android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />

<!--
3. requestLegacyExternalStorage:
- Required on Android 10 if you need to maintain legacy external storage behavior.
- This flag is ignored on Android 11 (API 30) and higher for new app installs,
but it does help in migration scenarios (e.g. for existing user upgrades).
-->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
tools:targetApi="31" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
tools:targetApi="31" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher_icon_map"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_icon_map_round"
android:supportsRtl="true"
android:theme="@style/Theme.Material3.DayNight.NoActionBar"
android:theme="@style/Theme.App"
android:requestLegacyExternalStorage="true"
>

<activity
android:name=".presentation.activity.ReplayActivity"
android:exported="false" />
<activity
android:name=".presentation.activity.RecordingActivity"
android:exported="false" />

<!-- Google Maps API key metadata -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key"/>

<activity
android:name="com.openpositioning.PositionMe.presentation.activity.MainActivity"
android:exported="true"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

</manifest>
android:usesCleartextTraffic="true"
>

<activity
android:name=".presentation.activity.ReplayActivity"
android:exported="false" />
<activity
android:name=".presentation.activity.RecordingActivity"
android:exported="false" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}" />

<activity
android:name="com.openpositioning.PositionMe.presentation.activity.MainActivity"
android:exported="true"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

</manifest>
22 changes: 22 additions & 0 deletions app/src/main/assets/magnetic_grid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": 1,
"description": "Magnetic heading compensation grid in local meter coordinates",
"grid": [
{
"x": 10.0,
"y": 15.0,
"correctionRad": 0,
"confidence": 0.9,
"sampleCount": 25,
"updatedAt": 1774828800000
},
{
"x": 15.0,
"y": 15.0,
"correctionRad": 0,
"confidence": 0.8,
"sampleCount": 18,
"updatedAt": 1774828800000
}
]
}
Loading