Skip to content

Commit

Permalink
[ADDED] Some doc on where to put JSON file for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hossain-khan committed Jan 26, 2025
1 parent 3f23a24 commit ec57807
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 5 additions & 1 deletion sample/src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ package dev.hossain.timeline.sample
import dev.hossain.timeline.Parser
import java.io.File

/**
* Main entry point for testing the parser.
*/
suspend fun main() {
println("Hello Sample!")
val parser = Parser()
// Add the file in `sample/src/main/resources` directory
val resource = {}.javaClass.getResource("/device-timeline.json")
if (resource != null) {
val file = File(resource.toURI())
Expand All @@ -18,6 +22,6 @@ suspend fun main() {
val activityTypes: List<String> = timeline.rawSignals.map { it.activityRecord?.probableActivities?.map { it.type} ?: emptyList() }.flatten().distinct().sorted()
println("Unique activities: $activityTypes")
} else {
println("Resource not found")
println("The device timeline file not found in `sample/src/main/resources` directory.")
}
}
Empty file.
4 changes: 0 additions & 4 deletions sample/src/main/resources/data.json

This file was deleted.

0 comments on commit ec57807

Please sign in to comment.