Does GPS require Internet?

后端 未结 5 1416
我在风中等你
我在风中等你 2020-11-28 04:56

Is it necessary to turn both Internet and GPS on before I can read my current location(country, city, locality etc) in my app? If they are, then an

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 05:17

    There are two issues:

    1. Getting the current coordinates (longitude, latitude, perhaps altitude) based on some external signals received by your device, and
    2. Deriving a human-readable position (address) from the coordinates.

    To get the coordinates you don't need the Internet. GPS is satellite-based. But to derive street/city information from the coordinates, you'd need either to implement the map and the corresponding algorithms yourself on the device (a lot of work!) or to rely on proven services, e.g. by Google, in which case you'd need an Internet connection.

    As of recently, Google allows for caching the maps, which would at least allow you to show your current position on the map even without a data connection, provided, you had cached the map in advance, when you could access the Internet.

提交回复
热议问题