You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[x]#10 Test 'Roll Lunch' functionality works without crashing on Android
38
+
-[x]#11 Test 'List' navigation works without crashing on Android
39
+
-[x]#12 Test adding restaurants works without crashing on Android
40
+
-[x]#13 Verify database persists data correctly across app restarts on Android
41
+
-[x]#14 Document Android-specific database configuration changes in implementation notes
41
42
<!-- AC:END -->
43
+
44
+
## Implementation Plan
45
+
46
+
<!-- SECTION:PLAN:BEGIN -->
47
+
1. Add tauri-plugin-devtools to Cargo.toml for debugging
48
+
2. Initialize devtools plugin in lib.rs (debug builds only)
49
+
3. Identify root cause: dirs::data_local_dir() doesn't work on Android - need Tauri's path resolver
50
+
4. Refactor Database to accept custom path via constructor
51
+
5. Use Tauri's app.path().app_data_dir() in setup hook to get correct Android path
52
+
6. Pass path to Database::new_with_path() during app initialization
53
+
7. Build and test on Android emulator
54
+
<!-- SECTION:PLAN:END -->
55
+
56
+
## Implementation Notes
57
+
58
+
<!-- SECTION:NOTES:BEGIN -->
59
+
**Root Cause**: The `dirs` crate's `data_local_dir()` doesn't work on Android - it can't resolve the app-specific data directory. Android apps require the Android context to get the correct data path.
60
+
61
+
**Fix Applied**:
62
+
1. Added `Database::new_with_path(path: PathBuf)` method to accept custom database path
63
+
2. Changed database initialization from lazy `OnceLock::get_or_init()` to explicit initialization in Tauri's `setup` hook
64
+
3. Used `app.path().app_data_dir()` - Tauri's cross-platform path resolver that works correctly on Android, iOS, macOS, and all other platforms
65
+
4. Added `tracing` crate for logging database path during initialization
66
+
67
+
**Devtools Setup** (desktop only):
68
+
- Added `tauri-plugin-devtools` as optional dependency with `devtools` feature flag
0 commit comments