Skip to content

Commit ef6cfcd

Browse files
committed
checkpoint
1 parent 812ec6c commit ef6cfcd

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
0 Bytes
Loading

mobile/src/main/java/net/activitywatch/android/MainActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
7878
}
7979
}
8080
})
81+
82+
// Test RustInterface functions (remove after testing)
83+
RustInterface(this).test()
8184
}
8285

8386
override fun onResume() {

mobile/src/main/java/net/activitywatch/android/RustInterface.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class RustInterface (context: Context? = null) {
4949
external fun getEvents(bucket_id: String, limit: Int): String
5050
external fun heartbeat(bucket_id: String, event: String, pulsetime: Double): String
5151
external fun query(query: String, timeperiods: String): String
52+
external fun androidQuery(timeperiods: String): String
5253

5354
fun sayHello(to: String): String {
5455
return greeting(to)
@@ -173,8 +174,6 @@ class RustInterface (context: Context? = null) {
173174
?: android.os.Build.MODEL ?: "Unknown"
174175
}
175176

176-
fun query
177-
178177
fun test() {
179178
// TODO: Move to instrumented test
180179
Log.w(TAG, sayHello("Android"))
@@ -187,7 +186,11 @@ class RustInterface (context: Context? = null) {
187186
Log.w(TAG, getBucketsJSON().toString(2))
188187
Log.w(TAG, getBucketsJSON().toString(2))
189188
Log.w(TAG, getEventsJSON("test").toString(2))
190-
val timeintervals = "[${"\""}${Instant.now()}/${Instant.now()}${"\""}]"
189+
val timeintervals = "[\"2026-01-31T00:00:00+03:00/2026-01-31T23:59:59+03:00\"]"
191190
Log.w(TAG, query("events = query_bucket(\"test\"); RETURN = events;", timeintervals))
191+
192+
// Test androidQuery (queries aw-watcher-android-test bucket)
193+
Log.w(TAG, "Testing androidQuery for Jan 31, 2026")
194+
Log.w(TAG, androidQuery(timeintervals))
192195
}
193196
}

0 commit comments

Comments
 (0)