IvoGoman / Diabetes-App

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

[Bug] #56

Closed JanWe92 closed 8 years ago

JanWe92 commented 8 years ago

The app is not starting anymore because of the following exception in the recommendation:

bildschirmfoto 2016-07-13 um 12 18 51
StefanHelmstetter commented 8 years ago

Seems that the timestamp is somewhere incorrectly stored.

JanWe92 commented 8 years ago

Another bug after reinstallation: 07-13 14:01:07.251 19334-19334/uni.mannheim.teamproject.diabetesplaner E/AndroidRuntime: FATAL EXCEPTION: main Process: uni.mannheim.teamproject.diabetesplaner, PID: 19334 java.lang.RuntimeException: Unable to bind to service uni.mannheim.teamproject.diabetesplaner.DataMining.Recommendation.BSInputRecommendation@14052e6a with Intent { cmp=uni.mannheim.teamproject.diabetesplaner/.DataMining.Recommendation.BSInputRecommendation }: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at android.app.ActivityThread.handleBindService(ActivityThread.java:3202) at android.app.ActivityThread.access$2000(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1537) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at uni.mannheim.teamproject.diabetesplaner.Database.DataBaseHandler.getMostRecentMeasurmentValue(DataBaseHandler.java:610) at uni.mannheim.teamproject.diabetesplaner.DataMining.Recommendation.BSInputRecommendation.recommend(BSInputRecommendation.java:127) at uni.mannheim.teamproject.diabetesplaner.DataMining.Recommendation.Recommendation$1.run(Recommendation.java:55) at uni.mannheim.teamproject.diabetesplaner.DataMining.Recommendation.Recommendation.startRecommendation(Recommendation.java:63) at uni.mannheim.teamproject.diabetesplaner.DataMining.Recommendation.BSInputRecommendation.onBind(BSInputRecommendation.java:91) at android.app.ActivityThread.handleBindService(ActivityThread.java:3189) at android.app.ActivityThread.access$2000(ActivityThread.java:177)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1537)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:145)  at android.app.ActivityThread.main(ActivityThread.java:5951)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) 

StefanHelmstetter commented 8 years ago

Seems that there is no bloodsugar measurement in the database, therefore getMostRecentMeasurementValue() returns an empty list and but the value at index 0 is tried to be accessed. Just commet out the start and stop of the BSInputRecommendation in the EntryScreenActivity

StefanHelmstetter commented 8 years ago

The first error I can not reproduce. So I assume that you somewhere put in an Unix timestamp (long) instead of the sql.Timestamp at some place. When querying for it then you got an exception because the function was not able to parse the String which is stored in the database as a sql.Timestamp because it was a long timestamp. The latter error was similar as described.