Watch Face vs. Watch App (and permissions)

Former Member
Former Member
Hello,

I'm currently developing a watch face. This should show
  • a notification counter
  • the steps / goal
  • the last heart rate
  • the battery level


How I see this, it is possible. But which permissions are needed in my manifest file? I don't want to request unrelated permissions.
Is it possbile to use vibrate() or this a watch app only functionality?

Cheers
  • Former Member
    Former Member over 8 years ago
    vibrate() belongs to Attention module. Attention module has doc comment:
    //! The Attention module allows for making pre-defined sounds. Not all devices
    //! support this API.
    //! @since 1.0.0
    //! @apptype Data Field
    //! @apptype Widget
    //! @apptype App

    So App, Data Field and Widget should allow vibrating, unless documentation is lacking on vibrate() method.

    Additionally vibrate method has defined supported devices:
    All non-Edge devices. Note: Forerunners and EDGE devices do not support vibration patterns.

  • Hello,

    I'm currently developing a watch face. This should show
    • a notification counter
    • the steps / goal
    • the last heart rate
    • the battery level


    How I see this, it is possible. But which permissions are needed in my manifest file? I don't want to request unrelated permissions.

    No special permissions needed for this (2.1.2 - IIRC, you needed "steps" in 2.1.0) When you run something in the simulator, it will tell you if you need to add the permission for something.
    Is it possible to use vibrate() or this a watch app only functionality?
    Cheers

    Nope. But it's not just for watch-apps. You can use it for widgets and as of 2.1.x, data fields. Just not watch faces.

    Update: I forgot to mention that for HR, you'll probably use "getHeartRateHistory()" in ActivityMonitor (or from SensorHistory). While it will run for all targets in the simulator, on real devices, it's only available on devices with WHR, and will crash the app if you call it on other devices. You'll want to use "has" to see if it's available before calling it. ("has" will always be "true" for it in the sim)
  • Former Member
    Former Member over 8 years ago
    Thank you both.
    I'm very careful at the moment, this is my first Connecht IQ project. I have no idea what happens if the app crash.
    It is enough to check like this?

    if ((Act has :HeartRateIterator) == false) {
    showHr = false;
    //System.println("No HR found.");
    }


    I have several questions :)

    What is WHR?
    What if the device supports HR through external devices and it is not connected. Is the return value "INVALID_HR_SAMPLE"?
    Is it possible to run apps in debug mode at attached devices like Android phone over adb?

    Best regards

    Edit: To my third question: Is it possible to test apps on real devices without deploying it to the app store?
  • Thank you both.
    I'm very careful at the moment, this is my first Connecht IQ project. I have no idea what happens if the app crash.
    It is enough to check like this?

    if ((Act has :HeartRateIterator) == false) {
    showHr = false;
    //System.println("No HR found.");
    }


    It depends on what "Act" is. If it's ActivityMonitor, then yes!
    I have several questions :)

    What is WHR?
    What if the device supports HR through external devices and it is not connected. Is the return value "INVALID_HR_SAMPLE"?

    The Wrist Heart Rate = oHRM on some watches. You can see the supported devices in the API documentation for getHeartRateHistory().
    for other devices, that's why you need "has" as it's not listed for the "supported devices".

    Is it possible to run apps in debug mode at attached devices like Android phone over adb?
    Edit: To my third question: Is it possible to test apps on real devices without deploying it to the app store?

    There is no sort of interactive debugging, but yes, you can test apps without using the app store. See the "New Developer FAQ" at the top of this forum, and "sideloading" in the Programmer's guide that's part of the SDK..
  • Former Member
    Former Member over 8 years ago
    Thank you Jim, good job! Connect IQ is so much fun :)
    It would be nice to have a like button for posts, to honor the answers and commentators It's better to waste threads with "thank you's". Anyway.....
  • No problem! We were all new at one time!