Android wearable GPS on moto 360 gen 1

ぃ、小莉子 提交于 2019-12-12 05:16:27

问题


I would like to develop a app on the moto 360 that gets the users current gps coordinates, is this possible even though they say it doesnt have built in gps connectivity? The reason I ask is it also says you can "track your watches location".. How would this be possible if it doesnt have gps? Does it just use the host device for this?


回答1:


  1. Is this possible even though they say it doesnt have built in gps connectivity?

Yes it is possible, based on the document "Detecting Location on Android Wear":

Location awareness on wearable devices enables you to create apps that give users a better understanding of their geographic position, movement and what's around them.

Some wearable devices include a GPS sensor that can retrieve location data without another tethered device. However, when you request location data in a wearable app, you don't have to worry about where the location data originates; the system retrieves the location updates using the most power-efficient method. Your app should be able to handle loss of location data, in case the wear device loses connection with its paired device and does not have a built-in GPS sensor.


  1. How would this be possible if it doesnt have gps? Does it just use the host device for this?

It is possible for wearable devices to rely on a tethered connection for location data.

How to check for on-device location sensors, receive location data, and monitor tethered data connections.

  • Connect to Google Play Services
  • Request Location Updates
  • Detect On-Board GPS
  • Handle Disconnection Events
  • Synchronize Data

NOTE:

Not all wearables have a GPS sensor. If your user goes out for a run and leaves their phone at home, your wearable app cannot receive location data through a tethered connection. If the wearable device does not have a sensor, you should detect this situation and warn the user that location functionality is not available.

Wearable devices relying on a tethered connection for location data may lose their connections abruptly. If your wearable app expects a constant stream of data, you must handle the disconnection based upon where that data is interrupted or unavailable. On a wearable device with no onboard GPS sensor, loss of location data occurs when the device loses its tethered data connection.

In cases where your app depends on a tethered data connection for location data and the wear device does not have a GPS sensor, you should detect the loss of that connection, warn the user, and gracefully degrade the functionality of your app.

Wear device without a built-in gps will depend on the paired handheld gps to get or be aware of its location.

Hope this helps!



来源:https://stackoverflow.com/questions/39150631/android-wearable-gps-on-moto-360-gen-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!