Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HabitTimer

This application demonstrates habit tracking with timer functionality for HarmonyOS wearable devices. It uses the Preferences API for data persistence and provides a wearable-optimized interface for tracking time spent on daily habits like reading, exercise, meditation, study, and practice.

Preview

Use Cases

  • Daily Habit Tracking: Track time spent on important habits with automatic daily reset at midnight.
  • Focus Timer: Use as a stopwatch to measure time spent on activities with start/pause/reset controls.
  • Progress Monitoring: View daily and total time invested in each habit on your wrist.

Tech Stack

  • Languages: ArkTS
  • Frameworks: HarmonyOS SDK 5.1.0 (API 18)
  • Tools: DevEco Studio 5.1.0 or later
  • APIs: @kit.AbilityKit, @kit.ArkUI, @kit.ArkData (Preferences API)

Directory Structure

entry/src/main/ets/
|---entryability
|   |---EntryAbility.ets              // Application lifecycle management
|---pages
|   |---Index.ets                     // Main UI with timer and habit list
|---services
|   |---HabitService.ets              // Timer and habit business logic
|   |---PreferencesService.ets        // Data persistence wrapper
|---models
|   |---HabitModel.ets                // Data types and interfaces

Constraints and Restrictions

Supported Device

  • HarmonyOS wearable devices supporting SDK 5.1.0 (API 18)
  • Huawei Watch GT series (with ArkTS support)
  • Huawei Watch D series (with ArkTS support)

Limitations

  • Timer pauses when app goes to background; must be manually restarted when returning to foreground.
  • Habits are pre-configured in code; no UI to add/remove/edit habits.
  • Uses Preferences API for storage; not suitable for extensive historical data tracking.

License

HabitTimer is distributed under the terms of the MIT License.

See the LICENSE for more information.

About

Habit stopwatch for HarmonyOS watches with daily/total time in ArkData Preferences; runs only while the app is foregrounded.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages