Personal harm-reduction tracker for CBD and THC intake β built with Kotlin & Material Expressive 3.
CBD & THC Counter is a private, offline-first personal tracking app. No account required, no data leaves your device. It helps you monitor your daily CBD and THC intake with a clean, expressive UI β so you can make informed, mindful decisions about your consumption.
β οΈ This app doesn't work as a medical device. It does not provide medical advice and does not promote substance use. Use responsibly and always consult a healthcare professional for health-related decisions, and DYOR (DoYourOwnResearch) ALWAYS.
This app does not promote substance use at all, but here is a message: everybody is free to do whatever they want with their body and mind (as long as their actions don't cause harm to others), and getting real information about it without political bias, and promoting to you and others harm reduction and responsible use. Everyone is free, as long as their actions don't cause harm to others: "Non-Aggression Principle: Libertarian Foundation"
Comming soon!
- Separate CBD and THC counters for the same day
- Quick +1 button to count CBD.
- Infused add β log a session tagged as weed πΏ or pollen π« (always counts as THC)
- β1 correction with confirmation dialog and chance to delete or keep the note linked to it, if there is any; feedback shown if counter is already at 0
- Reset with confirmation β resets only the active substance for today
- Monthly grid with a mood emoji on each day reflecting that day's total intake
- Tap any day to open a Day Modal with full breakdown (CBD, THC, voice note, timestamp log)
- Previous/next month navigation
- Emoji legend β full intake scale explained at a glance
- Today / Week / Average / Clean streak metric cards β ME3 Expressive colors:
- Today β ice blue Β· Week β warm orange Β· Average β lime green Β· Streak β lavender
- Patterns section β busiest day of the week by average intake
- Embedded mini line chart (7D / 14D / 30D)
- Full-screen smooth line chart: 7D Β· 14D Β· 30D Β· 60D ranges
- Navigate backwards in time with β β arrow buttons
- Value labels with smart label-skip for crowded 30D/60D views
- Record a short audio note for any day directly from the history or Day Modal
- Playback and delete β stored privately on-device (M4A format)
- Handles
RECORD_AUDIOpermission request on first use
- Export all history as a
.csvfile (shareable with any spreadsheet app) - Import from a
.csvβ restores or merges per-day data - Access from top-right icons (β export Β· β import, and yeah is reversed as usual icons are about this, but I don't agree seeing it as contradictory when it's actually inverted)
- Full redesigned Material Expressive 3 day/night theme, till v1.5
- Toggle βοΈ/π button always visible in the top-right icon column
- Status bar icons adapt automatically (dark in light mode, light in dark mode)
- Preference persisted across sessions
- ME3 card design: solid purple
#6750A4(light) / deep indigo#1E1640(dark) - Shows: date Β· CBD/THC mode badge Β· mood emoji Β· total counter
- Four action buttons: πΏ Weed Β· βΊ Reset Β· π« Pollen Β· +1
- Midnight auto-refresh via AlarmManager
- Switch default tracking mode: CBD β THC (this part of the app need to be improved to offer a proper design if only THC is selected)
- Customize emojis for each intake level (reflected on counter, calendar, widget)
- CSV export/import for backup & restore
| Layer | Technology |
|---|---|
| Language | Kotlin 2.0 |
| UI | Material Design 3 / Material Expressive 3 |
| Architecture | Single-Activity + Fragments + BottomSheetDialogFragment |
| Storage | SharedPreferences (zero dependencies, offline-first) |
| Audio | MediaRecorder API β M4A/AAC |
| Chart | Custom LineChartView β Canvas API, Catmull-Rom spline |
| Widget | AppWidgetProvider + RemoteViews |
| Theme system | AppCompatDelegate DayNight + values-night/ token overrides |
| Min SDK | API 26 (Android 8.0 Oreo) |
| Target SDK | API 35 (Android 15) |
app/src/main/
βββ java/com/d4vram/cbdcounter/
β βββ MainActivity.kt # Main counter + history
β βββ DashboardActivity.kt # Stats dashboard + mini chart
β βββ CalendarActivity.kt # Monthly emoji calendar
β βββ EvolutionActivity.kt # Full-screen evolution chart
β βββ DayModalFragment.kt # Per-day detail bottom sheet
β βββ VoiceNoteBottomSheet.kt # Audio recording/playback
β βββ CBDWidgetProvider.kt # Home screen widget provider
β βββ Prefs.kt # SharedPrefs wrapper (all data I/O)
β βββ EmojiUtils.kt # Emoji scale engine
β βββ LineChartView.kt # Custom Canvas line chart
βββ res/
βββ values/ # Light theme colors + all strings (es)
βββ values-night/ # Dark theme color token overrides
βββ drawable[-night]/ # Shape drawables (dual-theme)
| Version | Highlights |
|---|---|
| v1.5 | Material Expressive 3 Β· Light/Dark toggle βοΈπ Β· ME3 Dashboard cards Β· Widget ME3 redesign Β· Evolution 14D/60D Β· label-skip chart fix |
| v1.4.1 | Calendar + emoji map Β· Statistics dashboard Β· Voice notes crash fix Β· CSV import/export Β· broken buttons replaced |
| v1.4 | Dual CBD/THC counter Β· History tabs (Week / Month / All) Β· Day Modal |
| v1.3 | Home screen widget Β· Settings & emoji customization |
| v1.0β1.2 | Initial release Β· Basic counter Β· Simple history |
git clone https://github.com/d4vram/CBDcounter2.git
cd CBDcounter2
git checkout main # stable releaseOpen in Android Studio Ladybug 2024.2+ and run on device/emulator with API 26+.
Pre-built APKs available on the Releases page.
- β 100% offline β no internet permission declared
- β No analytics, no crash reporting, no tracking
- β
All data lives in
SharedPreferencesand private app storage. Working on SAF (Storage Access Framework) to be able to save the data in the folder you want to choose, and not in android/data/ by default (not accessible without root permission in phone) - β Voice notes stored in private internal storage β inaccessible to other apps
- i18n: ~30 hardcoded Spanish strings in layouts β needs migration to
strings.xml+values-en/ - Responsive widget layouts for 2Γ3 (show CBDΒ·THC split line when widget is enlarged)
- Dark mode auto-follow system setting (currently manual toggle only)
- Room DB migration for larger data sets (currently SharedPreferences)
GPL-3.0 β see LICENSE.
This application is a personal tracking tool only, as I stated at the beginning of the doc. It is not a medical device, does not provide medical advice and does not promote or facilitate the purchase or sale of any substance. Always consult a qualified healthcare professional for health-related decisions, and take good decisions by your own with the correct information and measure.
''If you don't use your mind, no worries: other people will use it for you''