Search code examples
wear-ossony-smartwatch

Is there a Sony SmartWatch 3 emulator/AVD/skin with GPS?


This code return false in Wear API 22:

    PackageManager pm = getPackageManager();
    boolean hasGps = pm.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS);

Per default in Android Studio AVD Manager for Wear AVD there is no GPS option. However if I "Clone Device..." (guess same as "New Hardware Profile") an existing one and then edit it, there is an GPS option. Still the AVD does not return true (code above). There is an option "Import Hardware Profiles".

Does Sony have a "Hardware Profile" which I can import?

How can I test my local Wear GPS (without buying Sony SmartWatch 3 hardware)?

Is there a Sony Smartwatch 3 emulator/AVD/skin?

enter image description here


Solution

  • Not all Android Wear devices provide a GPS unit. Instead, you should use the FusedLocationProviderApi from Google Play Services to request location updates. The nice part about this API is that if your phone and watch are together, it will use the GPS in the phone to save battery - it will only use the GPS on the wearable when it is disconnected from the phone. The FusedLocationProviderApi uses the same API as available on phones, so you can reuse most of your existing code.

    Here is a blog post I wrote about this: http://android-developers.blogspot.com/2014/10/gps-on-android-wear-devices.html

    Documentation for FusedLocationProviderApi: https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi

    And a sample that implements this: https://github.com/googlesamples/android-SpeedTracker

    There is no emulator that provides the GPS functionality of the Sony SmartWatch 3.