IvoGoman / Diabetes-App

Development Repository for the Team Project HWS 2015/ FSS 2016
1 stars 0 forks source link

[DataBaseHandler/Measurement Input] measurements not stored/retrieving does not work #62

Closed StefanHelmstetter closed 8 years ago

StefanHelmstetter commented 8 years ago

dbHandler.getMeasurements() returns an empty list.

Either the input does not work (in Settings and DailyRoutineFragment) or the getMeasurments() function does not work.

nayera-muhammad commented 8 years ago

thats because the method is retrieving values from the tab I removed.. I haven't added any backend for the new add measurements on the entry screen.. I was waiting for you to finish cuz as I understood there was something wrong going on your side... hope I got the issue right

IvoGoman commented 8 years ago

I could only find a method dbHandler.getMeasurements() in the commented section at the bottom of the class.

StefanHelmstetter commented 8 years ago

Sorry getMeasurementValues()

IvoGoman commented 8 years ago

The parameters you are using are looking fine. I tried it myself and did not get any results after entering some values via the Dialog for the Measurement Input on the Daily Routine Fragment. Therefore I pulled the Database from the Device and looked into the Measurements Table it was empty. Seems to be an issue storing the values into the Database

IvoGoman commented 8 years ago

The InsertInsulin Methods (Line 315 & 323) inside the DBHandler are never used and the InsertBloodsugar Method (Line 295) is only used in the BSInputRecommendation & bloodsugar_dialog classes. Since to my knowledge the bloodsugar dialog class is deprecated we are not storing any values. @nayera-muhammad is this true?

nayera-muhammad commented 8 years ago

yes that what I was trying to say before when we had the measurements stored in another tab the data base was set up and I think leonid did it with me cuz am not sure how actually we implement the DB in our fragments.. since we changed it to the entry screen only the layout is there but no backend.. ill contact leonid to help me out to store values.

IvoGoman commented 8 years ago

It works the same way as before. Like this you can retrieve the data. ArrayList<MeasureItem> insulinList = AppGlobal.getHandler().getMeasurementValues(AppGlobal.getHandler(),date,"DAY","insulin"); To store a bloodsugar value this method is the one: void InsertBloodsugar(DataBaseHandler handler, Date date, Time time, int profile_id, double bloodsugar_level, String measure_unit)

nayera-muhammad commented 8 years ago

measurements stored using InsertBloodsugar and InsertInsulin methods in DBHandler