Giter Site home page Giter Site logo

calnmacs's Introduction

My Personal Calorie Tracker Android App

##AIM

Also, I wanted calorie tracking to be as simple as possible. I didn't like the bloated, feature-rich apps that's in the store, so I wanted to make a minimalistic app that just tracks your calories, the macros, and included an editable database.

The food database will not be [necessarily] based on any public databases out there, but a personal one that the user will be able to add to, delete from, and edit. If you're like me, on a day to day basis, I eat generally the same types of foods, so having a database of commonly eaten foods instead of an all encompassing list is much more manageable.

Progress: All basic features I wanted are implemented

Features and Layout

The app has two pages you can swipe to choose.

The left page (main page) has your foods eaten, where you can manage the foods you have eaten for the day. This should be saved between app suspensions/pauses/closures until you hit the TRASH button.

Foods will only have carb, fat, protein, and calorie counts. When choosing foods, you just need to choose the amount you have eaten.

The right page displays all foods in the database that you can add, remove, or edit.

I will prepopulate the database with my own foods for now, but in the future, I may have the app start off with an empty database and allow the user the ability to populate it with a preexisting csv file. Or some other easier means.

FUTURE FEATURES

  • Ability switch unit types for foods in the foods eaten list.
  • A sidepage which displays your target calories for the day and the current deficit or surplus.
  • Information for each food when choosing for foods eaten

calnmacs's People

Contributors

arkaic avatar

Watchers

 avatar

calnmacs's Issues

Create and prepopulate database with foods

Need to create then integrate it into the third party library SQLiteAssetHelper as it was needed to abstract database repopulation before the app opens (rather than making a bazillion insert statements in onCreate()).

[Enhance] Allow decimals for food data before displaying to food list page

Couple of options

"one is to create a custom SimpleCursorAdapter and override setViewText(). in your implementation check if the textview in question is passed and set the view value to what you desire. you have to convert from String to int (or float, what you need) to apply your precision.

another one is to implement SimpleCursorAdapter.ViewBinder, set it as a binder in your adapter's setViewBinder and do your thing in the binder's setViewValue"

http://stackoverflow.com/questions/19212813/simplecursoradapter-modify-data-before-load-into-listview

[Bug] Accessing an already closed DB object

04-08 11:53:09.331 28743-28743/org.arkaic.calnmacs E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.arkaic.calnmacs, PID: 28743
java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteQuery: SELECT * from foods;
at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:58)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:151)
at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:123)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:236)
at android.widget.CursorAdapter.getItemId(CursorAdapter.java:258)
at android.widget.AbsListView$RecycleBin.retrieveFromScrap(AbsListView.java:6868)
at android.widget.AbsListView$RecycleBin.getScrapView(AbsListView.java:6598)
at android.widget.AbsListView.obtainView(AbsListView.java:2345)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1281)
at android.widget.ListView.onMeasure(ListView.java:1188)
at android.view.View.measure(View.java:18796)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:664)
at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:731)
at android.view.View.measure(View.java:18796)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1560)
at android.view.View.measure(View.java:18796)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
at android.view.View.measure(View.java:18796)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1458)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:746)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18796)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18796)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1458)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:746)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18796)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643)
at android.view.View.measure(View.java:18796)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2108)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1224)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1460)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1115)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6023)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.