Listview with location sensor

I wanted to create a listview similar to Ifood’s so that it shows me which restaurants are near my location.

Does anyone know of any tutorials or can you give me suggestions?

Depends where do you have the restaurant locations

@pipechela,
I want the restaurants that are close to my current location.

You can use Google maps Api.

1 Like

@vknow360
Do you have an example of how to assemble the blocks in kodular?

Yes.
@plantdoc2018 made an app using maps Api for app competition.
Also AIA file is open source and downloadable.

@plantdoc2018, can you pass me the app link?

Note: The apk will not work until you edit the AIA by putting your own Google Place API key on right position.

I saw the model, but I need something like this: Image below
according to my location, listview will carry those closest to me

I mean, the data

@welingtongoncalvesfranca This is clearly an API service (possibly Google places API service, not sure) from where the data were being received. And the query parameters obviously included your location (geocordinates).

I can create this using firebase. No api needed .

@hitesh Can you explain how you did it?

yes i can create such list with location sensor. it takes lots of time and efforts to do so . so it will be paid. but its possible .

I think you are talking about listview design only its not a big deal @welingtongoncalvesfranca wants functionality i think foursquare api will help

@ShaikhSajidAli What´s “foursquare api” ?
I don’t know if I open another topic or stay here.
I await the suggestions of the moderators.
As I have experience with databases, I designed the app the way I describe below.
What I have in mind to do the same thing as @welingtongoncalvesfranca:

  • 1 app for users
  • 1 app for sellers - owners
  • 1 mysql database with tables: users, sellers.
  • invoke a script, to record longitude and latitude, within the “location changed” method. This may not be necessary as the stores (restaurants, pharmacies, etc.) are in fixed places. This idea would be if the sellers were moving (UBER).
  • Do a search in the SELECT database on what the user is looking for (PHP script) and return the stores that the user wants.
    -The question is how to calculate the current distance from the user (location sensor) to the seller (pharmacy, restaurant) according to the address recorded in the database?
    I found.
    DistanceCalc : Calculate distance between two places from coordinates
1 Like

you can use the openrouteservice.org api. They provided a route in json format, and other data, included the distance of that route

1 Like

Where do I find the “manual” for consuming the API?

you must create and account, and then create a apikey

https://openrouteservice.org/dev/#/signup
https://openrouteservice.org/dev/#/login

The manual
https://openrouteservice.org/dev/#/api-docs

For example, the directions, have this response
image

{“type”:“FeatureCollection”,“features”:[{“bbox”:[8.681436,49.41461,8.690123,49.420514],“type”:“Feature”,“properties”:{“segments”:[{“distance”:1322.8,“duration”:305,“steps”:[{“distance”:413.4,“duration”:99.2,“type”:11,“instruction”:“Head north on Wielandtstraße”,“name”:“Wielandtstraße”,“way_points”:[0,15]},{“distance”:130,“duration”:31.2,“type”:1,“instruction”:“Turn right onto Seitzstraße”,“name”:“Seitzstraße”,“way_points”:[15,18]},{“distance”:54.3,“duration”:13,“type”:0,“instruction”:“Turn left onto Quinckestraße”,“name”:“Quinckestraße”,“way_points”:[18,21]},{“distance”:511.5,“duration”:122.8,“type”:1,“instruction”:“Turn right onto Moltkestraße”,“name”:“Moltkestraße”,“way_points”:[21,35]},{“distance”:83,“duration”:7.5,“type”:0,“instruction”:“Turn left onto Handschuhsheimer Landstraße, B 3”,“name”:“Handschuhsheimer Landstraße, B 3”,“way_points”:[35,37]},{“distance”:130.6,“duration”:31.4,“type”:0,“instruction”:“Turn left onto Roonstraße”,“name”:“Roonstraße”,“way_points”:[37,40]},{“distance”:0,“duration”:0,“type”:10,“instruction”:“Arrive at Roonstraße, straight ahead”,“name”:"-",“way_points”:[40,40]}]}],“summary”:{“distance”:1322.8,“duration”:305},“way_points”:[0,40]},“geometry”:{“coordinates”:[[8.681496,49.41461],[8.68149,49.414711],[8.681441,49.415655],[8.681436,49.415747],[8.681455,49.415835],[8.681509,49.416087],[8.681642,49.416498],[8.681671,49.416588],[8.681701,49.416684],[8.681875,49.417287],[8.68189,49.417394],[8.681868,49.417475],[8.681865,49.41748],[8.681775,49.417627],[8.681573,49.418169],[8.681536,49.418268],[8.681659,49.418292],[8.683161,49.418548],[8.683276,49.41856],[8.683257,49.418636],[8.683168,49.418995],[8.683157,49.419042],[8.683291,49.419058],[8.684872,49.419242],[8.68501,49.419258],[8.685156,49.419273],[8.686408,49.419402],[8.68651,49.419413],[8.686617,49.419425],[8.686983,49.419461],[8.687101,49.419473],[8.687212,49.419486],[8.688301,49.419619],[8.688398,49.41963],[8.690104,49.419828],[8.690123,49.419833],[8.689854,49.420216],[8.689652,49.420514],[8.68963,49.42051],[8.688601,49.420393],[8.687872,49.420318]],“type”:“LineString”}}],“bbox”:[8.681436,49.41461,8.690123,49.420514],“metadata”:{“attribution”:“openrouteservice.org | OpenStreetMap contributors”,“service”:“routing”,“timestamp”:1584026185012,“query”:{“coordinates”:[[8.681495,49.41461],[8.687872,49.420318]],“profile”:“driving-car”,“format”:“json”},“engine”:{“version”:“6.0.0”,“build_date”:“2020-01-16T14:21:32Z”,“graph_date”:“0000-00-00T00:00:00Z”}}}

No need to reinvent the wheel!

Thanks !!!

1 Like