탭 한 번으로 여러 항목을 동시에 세는 멀티 카운터
com.watch_go.multicounterWear OS 워치와 Android 모바일에서 작동하는 다용도 카운터 앱입니다. 화면을 탭해 숫자를 세는 싱글 카운터부터 2~4인 보드게임 스코어 카운터까지 한 앱에서 해결하며, 디지털 시계/스톱워치, 세션 히스토리, 이미지 공유 기능을 함께 제공합니다. 모바일에서 이름·색상·목표·루프 등을 설정하면 워치로 실시간 동기화됩니다.
MainViewModel), Jetpack DataStoreMessageClient)CounterRecordDataStore (모바일) / HistoryManager (워치, 최대 50개 유지)모바일이 5초 간격으로 워치에 /sync-records-request를 보내 pull:
Mobile Wear
│ ── /sync-records-request ───────────────▶ │ (5초마다)
│ ◀── /sync-records-response ───────────── │ (wear 기록 JSON)
│ handleCounterRecordsResponse() │
│ counterRecordDataStore.addCounterRecords()│
│ ── /sync-records-response ───────────────▶│ (동기화 완료된 sessionId 회신)
│ │ historyManager.removeRecordsFromHistory()
| 경로 | 방향 | 용도 |
|---|---|---|
/sync-records-request |
Mobile → Wear | 동기화 요청 |
/sync-records-response |
양방향 | 기록 데이터 전송 / ACK |
/update-settings |
Mobile → Wear | 설정 동기화 |
/watch-version |
Wear → Mobile | 버전 정보 |
isActive=true 중 최신만 유지, 기존 title 보존isActive=false만 삭제 (활성 세션은 유지)data class CounterRecord(
val sessionId: String, // timestamp 기반 고유 ID
val startTime: String, // ISO 시작 시간
val endTime: String?, // ISO 종료 시간
val counter1Count..counter4Count: Int,
val counter1Color..counter4Color: Int,
val counter1Name..counter4Name: String, // 최대 10자
val mode: Int, // 싱글/듀얼/트리플/쿼드
val isActive: Boolean,
val activeDuration: Long, // ms
val title: String? = null // Mobile 전용
)
:app) — MainActivity가 주기적 동기화 트리거, MainViewModel이 MessageClient.OnMessageReceivedListener 구현:wear) — DataLayerListenerService가 메시지 수신·처리, HistoryManager가 DataStore에 기록 관리:watch-go-info-fragment, :onboarding