A simple and minimal app to track how long you've been sober from anything you want.

Last update: Aug 9, 2022

Sobriety

A simple and minimal app to track how long you've been sober from anything you want.

I mostly designed this out of spite for "I Am Sober", which monetizes addiction recovery. The whole app was written in a day (specifically 03/10/2022) in the spare time I had between classes. It's not perfect but it's usable, and I plan to improve it.

Repository Metadata (via Shields.io)

Core

GitHub GitHub Workflow Status Maintenance

Size

GitHub code size GitHub repo size

Release Info

GitHub all releases GitHub downloads by release (latest by date)

GitHub release (latest SemVer) GitHub Release Date IzzyOnDroid

Issue Counts

GitHub open issues GitHub closed issues

PR Counts

GitHub open pull requests GitHub closed pull requests

Stats

GitHub commit activity GitHub commits since latest release (by date)

GitHub contributors GitHub Discussions

GitHub

https://github.com/KiARC/Sobriety
Comments
  • 1. Cached times aren't working, even in previous releases

    I am 100% sure they worked before but now on every release on multiple devices the cached times don't reset correctly

    Expected: Reset time, close and open app, time is relatively small because of the recent reset Actual: Reset time, close and open app, time is back where it was

    I am genuinely baffled.

    Reviewed by KiARC at 2022-03-25 01:36
  • 2. Crash when reading old cache

    Unfortunately this bug seems to keep reappearing😄 The clean install of 5.1.4 works perfectly fine (also thanks for crediting me in the release notes) but when updating from 4.0.1 with an existing save file it crashes again.

    However this time its reproducible in the Emulator, so maybe that helps in getting rid of the bug.

    Steps to reproduce:

    1. Check out the revision of the repository where version was updated to 4.0.1
    2. Build and clean install this version on the emulator
    3. Open the app and create an entry
    4. Check out the current master branch (5.1.4) and update the app on the emulator by building and running again

    I appended the full crash log at the end, but the only relevant lines are

    Caused by: java.io.InvalidClassException: com.katiearose.sobriety.Addiction; at com.katiearose.sobriety.CacheHandler.readCache(CacheHandler.kt:17) at com.katiearose.sobriety.Main.onCreate(Main.kt:61)

    I don't really get why it crashes, because there is try catch blocks everywhere that should have caught that exception. Mabye its worth considering to use a different way of storage, since these FileOutPutStreams etc. are a bit tricky to debug. Since the data is very simple, you could use Android's Shared Preferences, and save the list as a serialized string in a single key value pair there. Or if you want to debug the current system, here is the full crash log:

    E/AndroidRuntime: FATAL EXCEPTION: main Process: com.katiearose.sobriety, PID: 21703 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.katiearose.sobriety/com.katiearose.sobriety.Main}: java.io.InvalidClassException: com.katiearose.sobriety.Addiction; local class incompatible: stream classdesc serialVersionUID = -8477717136644775154, local class serialVersionUID = 7971970991809636397 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3635) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Caused by: java.io.InvalidClassException: com.katiearose.sobriety.Addiction; local class incompatible: stream classdesc serialVersionUID = -8477717136644775154, local class serialVersionUID = 7971970991809636397 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:624) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1713) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1594) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1872) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427) at java.util.ArrayList.readObject(ArrayList.java:791) at java.lang.reflect.Method.invoke(Native Method) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1066) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2013) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1899) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1412) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427) at com.katiearose.sobriety.CacheHandler.readCache(CacheHandler.kt:17) at com.katiearose.sobriety.Main.onCreate(Main.kt:61) at android.app.Activity.performCreate(Activity.java:8051) at android.app.Activity.performCreate(Activity.java:8031) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:201)  at android.os.Looper.loop(Looper.java:288)  at android.app.ActivityThread.main(ActivityThread.java:7839)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 

    Reviewed by JakeGonder at 2022-08-03 09:35
  • 3. Bug: Out of memory exception when reading old files

    There seems to be an issue when updating the app, and then reading a save file created in the old version.

    Steps to reproduce: 1 Checkout version 3.0.0 2 Add a couple of entries 3 Checkout the newest version => update the app => start the app => app crashes with this error:

    java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
    

    Re-installing the app fixes this bug but also gets rid of previous entries.

    Reviewed by JakeGonder at 2022-03-25 19:11
  • 4. Refactored Main to use Recyclerview instead of manually created card objects

    I admit, this might look like a big change, but i promise it only has advantages😄 I refactored Main to use a RecyclerView to display the cards, replacing the createNewCard method.

    Advantages of using a recycler view:

    • More efficient (Views are "recycled" when scrolling)
    • Allows updating of all cards in sync
    • Animations for deleting / inserting
    • Design of cards is now easier to modify

    To put it simply, the logic part of createNewCard is now in the onBindViewHolder method of the Recyclerview Adapter, the design part of createNewCard is now fixed into the card_addiction.xml

    I also made some minor design changes, trying out if icons would work as reset / delete buttons, this is just a suggestion.

    ⚠️These changes still don't contain a fix for the current crash when trying to read old files.

    Reviewed by JakeGonder at 2022-03-27 19:17
  • 5. Average sober time

    I think it would be useful to log how long you were sober for and display an average (possibly of the last 3 resets) meaning users could aim for more (or less) time sober from something

    Reviewed by CactiChameleon9 at 2022-03-22 15:40
  • 6. initial Fastlane structure

    The bot complained, so here you go with a starter package. Be welcome using my Fastlane Cheat Sheet to build on this. Some hints for formatting full_description.txt can be found in my wiki.

    PS: With the next sync tomorrow around 19:00 UTC, your app will become available here in my repo, so you can already see what these Fastlane files will be converted into :smiley:

    Reviewed by IzzySoft at 2022-03-11 20:33
  • 7. IzzyOnDroid icon links to bigger image instead of app

    Basically the title. Just FYI, your IzzyOnDroid icon links to a bigger image instead of Izzy's repo.

    https://apt.izzysoft.de/fdroid/index/apk/com.katiearose.sobriety

    Reviewed by pod5tr45 at 2022-03-16 23:03
  • 8. Contribution guidelines

    Your ReadMe doesn't mention contribution guidelines, so im curious if you are open to PRs. I think your app is a cool idea so I forked your project and made some minor changes like adding confirmation dialogs for the delete / reset actions etc.

    Reviewed by JakeGonder at 2022-03-20 08:32
  • 9. Bug fix, code optimization, small ux changes

    • Fixed bug that would allow adding entries with duplicate names => 2 distinct elements would be displayed in the list, but only 1 would be saved due to identical keys in the hash map

    • Replaced prompt updating via looper with distinct update calls when:

      1. Activity is created
      2. Entry is deleted
      3. Activity is resumed (When returning from Create activity)
    • Moved Floating Action Button further away from the screen edge to make it more accessible, changed icon tint to white

    • Fixed typo in description

    Reviewed by JakeGonder at 2022-03-22 05:49
  • 10. Redesign

    Merge JakeGonder's redesign of the Create page as well as their confirmation dialogs for reset and delete actions.

    I really like the changes and am going to merge them and create a new release for the app.

    Reviewed by KiARC at 2022-03-21 17:19
  • 11. addiction list doubles

    I used to have one thing in my addiction list (Fresh new install from fdroid today) and a half hour later when i looked again the list has doubled to two duplicate addictions..

    This happened a few times

    I recently added another item to my list and only a few minutes later the list has doubled again to 4 items both items both duplicated.

    Reviewed by nutpantz at 2022-08-05 02:07
  • 12. stop\restart option over relapse

    Many people stop for a length of time rather then a one time relapse. Then they restart abstaining from whatever. It would be nice if that was an option over just a relapse button that restarts automatically. Maybe keep time since abstaining was stopped. I personally would feel better if i could restart a fresh new abstaining attempt from an existing button if i have stopped for a few days, where i would likely trash the last attempt over use the relapse button when i wanted to try abstaining again

    Reviewed by nutpantz at 2022-08-05 01:51
  • 13. option for years months days hours minutes

    While it's nice to have days hours, etc, not so much after you have over 1000 days. It's much more readable if there was an option for years, months, days, hours seconds.

    Personally i don't even need exact months since one is 28 days and others are 30 or 31, but it would be nice for the crazy exact people.

    Reviewed by nutpantz at 2022-08-04 23:14
  • 14. Visual tweaks

    1 Theme inconsistency: Currently the dark theme does have a title bar showing the app name, the light theme does not have one.

    2 Improvement idea: Don't show text parts containing 0's. E.g. for a new entry, don't show 0 days 0 hours etc, initially just show the seconds.

    3 Bug or feature? Its currently possible to set a date / time in the future, which then results in a negative time counting up.

    Reviewed by JakeGonder at 2022-03-30 18:51
  • 15. Cannot use on Huawei without Google

    Unfortunately, the App from F-Droid is not compatible with a Huawei P40 Lite E (cannot install).

    Does it requires Google Services ? Is there any way to use it without Google services ?

    Thanks for your great project and for using a GPLv3 License ! :)

    Reviewed by ghost at 2022-03-25 20:24
Android app that allows you to draw anything and turn it into a jigsaw puzzle.
Android app that allows you to draw anything and turn it into a jigsaw puzzle.

Android-Jigsaw-Puzzle Like to draw? Like to solve jigsaw puzzles? Try JigDraw! This is an Android app where a user draws something and use it to gener

Jul 4, 2022
Android app that helps you keep track of the medical supplements you need to take and how you spend your days
Android app that helps you keep track of the medical supplements you need to take and how you spend your days

Android app that helps you keep track of the medical supplements you need to take and how you spend your days, similar to a bullet journal. It also allows you to reflect on your day, week, year, etc.

Apr 9, 2022
A movie application where you can search a movie that you want and see the detail of movie
A movie application where you can search a movie that you want and see the detail of movie

MovieApp This is a simple movie application where you can search a movie that you want and see the detail of movie Technologies Hilt (Dependency Injec

Nov 30, 2021
CutableTextView - the super lightweight library that helps to you cut long text. ✂️
CutableTextView -  the super lightweight library that helps to you cut long text. ✂️

An easy to use CutableTextView when you need to cut a long text. ✂️ ✂️ ✂️ Gradle dependencies { implementation 'com.github.devit951:cutabletextvie

Aug 29, 2019
The News App has been carried out within the framework of the MVVM architecture, information about news is obtained by consulting an API, it is built usisng Jetpack Copose, Coroutines, Dependency Injection with Hilt and Retrofit

Journalist The News App consists of an application that displays the latest news from EEUU from an API that provides official and updated information.

Nov 3, 2021
Here OneSignal push and in-app-message have been implemented

OneSIgnal demo project Here we have implemented OneSignal inAppMessage and Push Notification ANDROID SDK SETUP WITH ONESIGNAL: https://documentation.o

Dec 7, 2021
Task Timer - An android app that helps you to keep a track of how much time you spend on each task
Task Timer - An android app that helps you to keep a track of how much time you spend on each task

Task Timer - An android app that helps you to keep a track of how much time you spend on each task

Feb 24, 2022
SlushFlicks has been built upon public APIs from IMDB.
SlushFlicks has been built upon public APIs from IMDB.

SlushFlicks SlushFlicks has been built upon public APIs from IMDB. This application helps users to view trending, popular, upcoming and top-rated movi

Jul 28, 2022
This assignment has been given to me for Android developer position at SonyLiv.

asssignmentSonyLiv This assignment has been given to me for Android developer position at SonyLiv. This codeis not full functional but can give a cont

Nov 21, 2021
This is an open source launcher project for Android devices that has been built completely from scratch
This is an open source launcher project for Android devices that has been built completely from scratch

Description This is an open source launcher project for Android devices that has been built completely from scratch. The main goal of this launcher is

Aug 9, 2022
A digital wellbeing Android app that helps minimise distractions when you don't want them
A digital wellbeing Android app that helps minimise distractions when you don't want them

Bundel is a digital wellbeing Android app, helping you to focus by grouping up notifications and only releasing them in batches, at set times. This minimises context switching and improves productivity, while decreasing the impulse to continuously check your phone.

Aug 5, 2022
With this simple app, you can keep track of your favourite cryptocurrency on your wrist.
With this simple app, you can keep track of your favourite cryptocurrency on your wrist.

Capstone project crypto Tracker ?? Final Product (05-06) V1.1 "somebody toucha my spaghet" feature set State Note Track the current price of a crypto

Jun 29, 2022
Loop Habit Tracker, a mobile app for creating and maintaining long-term positive habits

Loop is a mobile app that helps you create and maintain good habits, allowing you to achieve your long-term goals. Detailed graphs and statistics show you how your habits improved over time.

Aug 6, 2022
🎥 A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose.
🎥 A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose.

ComposeMovie Android ?? A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose. Built with

Jul 13, 2022
Android port of Simon Tatham's Puzzles. *git replace in use* - you might want to {{ git fetch origin 'refs/replace/*:refs/replace/*' }}

This is the README accompanying the source code to Simon Tatham's puzzle collection. The collection's web site is at <https://www.chiark.greenend.org.

Jul 27, 2022
A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools
A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools

Quotee Android ?? A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools. Developed with ❤️ by Aminullah

Jul 17, 2022
Money Manager app that helps you to add your daily small incomes and expenses and track them easily.
Money Manager app that helps you to add your daily small incomes and expenses and track them easily.

Simple Money Manager This app is a simple money manager app which helps you to add your daily small incomes and expenses and track them easily. Screen

Nov 21, 2021
🛒A Minimal Expense E-Commerce App built to demonstrate the use of modern android architecture components [Navigation, Room, MotionLayout, etc..] with MVVM Architecture. ✔
🛒A Minimal Expense E-Commerce App built to demonstrate the use of modern android architecture components [Navigation, Room, MotionLayout, etc..] with MVVM Architecture. ✔

E-Store A Simple E-Commerce App ?? built to demonstrate the use of modern android architecture component with MVVM Architecture ?? . Made with love ❤️

Jul 17, 2022