From the course: Code Clinic: C++

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution overview: Where am I?

Solution overview: Where am I? - C++ Tutorial

From the course: Code Clinic: C++

Start my 1-month free trial

Solution overview: Where am I?

- [Instructor] As I thought about to solve this challenge, I thought how I figure out where I am when I'm lost. If you're like me, you probably pull out your phone and open a map app. Or if I'm on a computer, I'll pull up a browser and go to a map site. In both cases, the phone or computer would make use of cell towers and Wi-Fi nodes that it sees around it to help determine where they are. Doing a bit of research, I found that Google has a Geolocation API to do just that. This isn't surprising when you think of how many other apps or websites display Google Maps to show you where a store, restaurant or service is located. When a computer sends a request to Google's Geolocation API, it includes information about its IP address, nearby Wi-Fi access points, cell towers and so on. It formats that data into a JSON request message which it sends to Google over HTTP using POST. And then Google responds with a JSON message…

Contents