Is it possible to make a function on appinventor which detects the nearest restaurants or anything else?

Welcome Presley.

See both of the links in post number 4 . Each shows a slightly different way to find stuff. These examples use the LocationSensor

or use this solution using only an activity starter and WIFI Find closest hairdresser - #5 by SteveJG

Show us what you tried if you still have a question