Skip to content

PatrickFarley/CapacitySheetWidget

Repository files navigation

Capacity Sheet Widget

Capacity Sheet Widget is an Android home screen widget that streamlines interaction with a user-owned Capacity spreadsheet. A Capacity spreadsheet is a Google Sheets document that uses the Capacity method to track time-based activities and goals.

User story

  • In the app, you enter the sheet ID, along with your Google account info.
  • The widget frontend takes input, and the app adds minutes to the selected category in the current week.

Process

widget view init

  1. MainActivity collects entered sheet information, saves it to preferences on ContinueButtonClick.
  2. MainActivity calls the init asynctask.
  3. MainActivity creates a return intent, sets it to the widgetId, and finishes.
  4. init asynctask gets and processes sheet data. Uses saved preferences to correctly make UI decisions.
  5. in onPostExecute of InitTask, it calls updateAppWidget to publish the correct UI data (the RemoteViews)

Data entry

a global, trans-widget-ID switch for the different modes. When a data button is pressed,

widget view update

  1. onUpdate: widget creates the asynctask, give it references to its remoteViews, and executes it
  2. asynctask executes, and in its onPostExecute method it updates its remoteViews
  3. asynctask calls updateAppWidget with the new remoteViews

Cat selector

  • OnClick saves catID index to preferences
  • TimerTask has the correct amount/index and triggers the write operation.
  • clicking on a cat highlights it and unhighlights the others
    • redraw the view with only that difference - it should be as quick as possible, and then save the new cat index to prefs.
    • part of ordinary view draw should involve querying the savedprefs to figure out which cat to highlight.

Parse Sheet coordinates

  • Async: get the **coordinates **of the current week (save to prefs)
  • Async: get the **catNames **(save to prefs)

Update UI

  • Async: to get current cell values and colors, categories, catCount, and currentweekindex (return special Results object)
  • Sync to construct a current remoteViews (then trigger OnUpdate)
  • need to set OnDataChanged to redraw all the catItems

WriteTask

  • Async: to get sheet raw data (using savedpref coordinates), manipulate it, and upload it (no return, but triggers an ordinary UI update)

so we have async operations.. need a way to trigger synchronous operations at the end. especially different ones.. we need a variable callback.

Structure: have a SheetsManager class that does all the sheets calls. (async). Instantiate it, passing in the needed args. call its classmethod through an executor, and line up a callback method too. And the callback method can come from a separate class, UIManager.

OnUpdate:

the app widget update should fetch the latest data, save it to sharedprefs, and trigger a UI update. But only every 30mins, and ideally only when device is unlocked (could create AlarmManager for this)

Backend

  1. Used local keytool utility to generate an Android Studio debugging SHA1 fingerprint for my machine.
  2. Created a Google Sheets API in the Google developer console, configured for that SHA1 fingerprint and the app's package name.
  3. for publish, I will have to use a different SHA1 fingerprint? I forget.

Open items:

check the processes above- are they accurate? don't use Toast to track the minute counter, use a text field in the UI.

Then make the UI updates for selected-cat-item and minute-counter-updated more lightweight by handling them in a diff intent from the complete UI update (which calls Sheets).

Features

The hiatus mechanism: a category must be 0 weight and then you're good. You don't have to make the ideal 0 minutes, but you kinda have to to keep the total to 730mins always.

  • I wish I didn't have the 730 limit, but then it's hard to normalize your performance. For other users, it's fine to increase the total. Seasons of high and low performance. For me, I might change it anyway. Then I could find a way to normalize the data, basically spoof the ideals so they add up to 730 again. Everything else should be fine.
  • and when a category is on hiatus, its totals shouldn't count toward the total minutes for the week.

Marketing

Pitch

  • "You own your data" - no mystery to where it lives.
  • Keep the spreadsheet, but create a widget and lightweight app that uses the sheets API to add to cells.
  • if you’re new to a productive lifestyle, starting with time-based goals, with gamified rewards, will get you to value the time in those activities, in the proper proportion. It’ll condition you to feel proud (ego) when you do them. And it'll enforce baseline habits (cooking, meditation, fitness) that make you more effective.
  • if you’re too focused on one thing, it’ll help enforce the balance that you want. Again, by conditioning you to value the time.
  • and once you have that, you’ll figure out thing-based goals: “If I’m going to spend time on X anyway, I might as well use it to complete this next thing-based goal”

Publication / sales

Patent Can you patent an application of data? A simple formula used in a very specific way? My formula for weighting categories based on their relative progress as of last week, is such a case.

it'd be a Utility patent

http://answers.google.com/answers/threadview?id=700594

  • might work like 5418902 Electronic spreadsheet system producing generalized answers including formulas

Digital Product Google marketplace for selling spreadsheet products? or Etsy?

Copy their entire model here: https://girlwhoexcel.com/products/ultimate-habit-tracker-spreadsheet?utm_campaign=cmp4&utm_content=1&fbclid=PAAabDXsDlew3XlxGu1wAJ8JbYfDiq9LBqqLwj44Yi-Ob7Fbkcho6hWeFP_nQ&external_browser_redirect=true

Maybe implement on notion too. Notion templates are lucrative apparently

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages