add geolocation to susi api call
See original GitHub issueCurrently the http://api.asksusi.com/susi/chat.json
api is called without a location information.
Expected Behaviour
For location-based services, we need the local geolocation of the android device. If the user has no GPS switched on, you can also use the fuzzy location that can be obtained in android using a network provider. The details are explained in the first answer of http://stackoverflow.com/questions/6181704/good-way-of-getting-the-users-location-in-android … please use that method.
That longitude and latitude parameter must be appended to the susi api call. Currently a call is like:
http://api.asksusi.com/susi/chat.json?timezoneOffset=-60&q=where+am+I
This must become a call like:
http://api.asksusi.com/susi/chat.json?timezoneOffset=-60&longitude=8.11&latitude=55.8&q=where+am+I
Steps to reproduce it
Use the android device to ask where you are. An example output will be provided as the solution evolves.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
That’s fine, we will have another issue to handle the map in a consistent way with the question ‘where is’
freegeoip should be considered as a nice-to-have add-on. It also rises the question if we need another attribute which declares the accuracy of the location which again rises the question on how to handle that.
Therefore let’s add another query attribute named
geosource
where you can set a text, one ofgps
(for LocationManager.GPS_PROVIDER)network
(for LocationManager.NETWORK_PROVIDER)ip
(for geoip)And please compute the geoip only if none of GPS_PROVIDER and NETWORK_PROVIDER is available. Please also do the call to freegeoip at most once.