zzzj15 / senior_design

1 stars 2 forks source link

Intelligent GPS location suggestion #8

Open zzzj15 opened 11 years ago

zzzj15 commented 11 years ago

Improve frequent choice taking GPS location into consideration. For example, the user usually have 5 hamburgers in location A, 4 hamburgers in location B and 3 hamburgers in location C. The user also had 6 bowls of rice in location A. The expected frequent choice ranking in location A is 1.rice (6 vs 5. although the user has entered hamburgers 12 times). 2. hamburger ( 5 times in location A).

To achieve this, first modify the food_gps table to look like this. _id | gpstime | gpslatitude | gpslongitude | fooditem | foodcategory | gi | quantity | frequency -----+---------+-------------+--------------+----------+--------------+----+----------+-----------

We have this implementation in databasehelper.java. However, one additional column needs to be added (frequency).

After having this table, we will work on how to insert values into the table. When the user clicks confirm, we save the food information and look up in the table if there is a matching record earlier within for example 0.5 miles. We would need to write a function to compare the current GPS location and the GPS location in the table if the distance is within 0.5 miles. When we try to insert 2 things may happen:

  1. The same food is entered earlier within 0.5 miles. The frequency counter will be incremented by 1.
  2. There is no previous record within 0.5 miles. We will insert a new row with the food information and the user's current GPS location.

Everytime the food tracking page is open, we do the following things to pop up the list,

  1. search all food entries within 0.5 miles.
  2. Provide the top 5 in the filtered result from 1.

This will accomplish our smart frequent choice suggestion.

TBPer commented 11 years ago

@zzzj15 Jing

Were you be able to get the GPS long and lad ?