ccomeaux / boardgamegeek4android

BoardGameGeek application for Android (unofficial)
GNU General Public License v3.0
228 stars 47 forks source link

Add get Location support #102

Closed tupaschoal closed 4 years ago

tupaschoal commented 6 years ago

This first version allows user to fill up the location field in the play logging by clicking a new button, that will automatically insert the city he's in, as long as the permission is granted.

As seen here on Trello

Some TODO notes:

  1. I didn't really know how to request the permission from the Activity, I saw there is some support within the DataFragment.java.
  2. I reused the location icon, for now, because I don't know where you source them from. Thought it was from the material design library provided by Google, but they don't have the same resolutions that the app has in the folder.
ccomeaux commented 6 years ago

My idea was to use the historical locations, not city names. So "My house" not "Birmingham". I think this would require us to store the lat/long of each location to look up proximity from the current lat/long. I'm not sure how to do that. Heck, we don't even store the location yet (it's just the list of unique locations in the plays table). Is this something you think can can work on?

tupaschoal commented 6 years ago

Historical locations as in what the user previously used, right?

I could work on that, but I don't see how we would store that, as the app currently builds the information out of what we fetch from BGG, right?

ccomeaux commented 6 years ago

Correct. We would have to build a locations table (with at least _id, name, lat, long) and store data there, much like we do with player colors.

tupaschoal commented 6 years ago

So we have a database somewhere we're sending data? (Really newbie question here, I admit)

Why don't we do it in a multi step process: 1 - We fill in the city as the user clicks the button. 2 - Later we build the database (?) and we provide a list of matches for him to choose: the one that matches the (lat, long) he previously used, name of locations nearby, name of the city and so on. 3 - Could be part of 2, but we can make him choose the default auto filling for 2, maybe even order the priority he wants to autofill: try to fill in with past data, if not try closest location, if not try city.

What do you think?