Quantcast
Channel: Garmin Developer Blog
Viewing all 89 articles
Browse latest View live

Changes to the Position Permission

$
0
0


In the past developers have had access to the user’s position via the Toybox.Activity.Info.currentLocation without a permission. This API provides live position information to data fields operating within an activity, and can be used by Watch Faces to acquire a last known location. In an upcoming change to Connect IQ, we will be changing the behavior of this API and require the Position permission. This change will be made retroactively back to Connect IQ 1.x devices, so developers should add the Position permission to their apps (including for Connect IQ 1.x products) before June 30th. Failure to do so will cause your apps to stop working after this change is implemented.


Something You’ve Been Waiting For: Trial Apps

$
0
0


Looking to monetize your content? You should create a trial app.

Trial apps are downloaded by the user in a locked form. When the user launches the locked version, they will be instructed by a device nag screen that the app is a locked version and given instructions on where to go to get the unlocked version. The app implementation can lock down functionality based on the value of the Application.isTrial. The nag screens and digital rights management (DRM) are enforced by the app store and the device, but the unlock experience is a web experience implemented by you. You can collect leads, check if they are a premium member, or monetize in your unlock experience. Once the user has completed the unlock experience, they will have access to the unlocked version from the app store.

You can to create trial versions of apps for the following devices:

  • Approach® S60
  • D2™ Charlie
  • Descent Mk 1
  • Edge 130
  • Edge 520
  • Edge 520 Plus
  • Edge 820
  • Edge 1000
  • Edge 1030
  • fēnix® 5 family
  • fēnix Chronos
  • Forerunner 645 family
  • Forerunner 735XT
  • Forerunner 935
  • vívoactive® HR
  • vívoactive® 3
  • Oregon 700 family
  • Rino® 700 family
  • If you want to enable trial functionality for your apps, do the following:

    1. Contact the Connect IQ Developer Program or reach out on the Connect IQ forums to get the integration documentation
    2. Submit your UX documents to your developer program contact for certification
    3. Upload a your app (with unlock experience) to the app store as a beta app
    4. Allow Garmin to test the unlock experience
    5. When approved, upload a new app to app store for approval

    We look forward to working with you!

    Five Things from Connect IQ Summit

    $
    0
    0

    Not able to come to the Connect IQ Developer Summit? You missed an awesome event, but thankfully we have some material to catch you up:

    1. Read recaps of the summit from MySwimPro and DC Rainmaker, and watch this recap video from MySwimPro:

    2. Browse photos from the summit
    3. Watch Ray Maker’s State of the Industry keynote:

    4. See the winners of the Connect IQ Developer Awards
    5. Download the beta of Connect IQ 3 with Maps, Music, and More

    Due to corruption during recording, we unfortunately do not have videos of the breakouts this year.

    As you can see it was an incredible event, and we hope you can join us next year. Like Ray says, the BBQ in KC is really good. (We’re biased, and can understand if you have other opinions).

    Connect IQ 2.4.7 Now Available!

    $
    0
    0


    Connect IQ 2.4.7 is here! We have added support for the fēnix® 5 Plus family, the most powerful Connect IQ wearables ever made. For athletes and outdoor adventurers, the fēnix 5 Plus Series watches are the high-performance way to beat yesterday and bring your maps and music along. These rugged, premium-crafted watches feature routable color mapping, wrist-based heart rate, storage for up to 500 songs and our Garmin Pay contactless payment solution.


    This version also adds support for the vívoactive® 3 Music. From playing sports to playing your favorite songs, vívoactive 3 Music is the smartwatch for your active life. It features on-device music storage, so you can bring your tunes along for every workout. This sporty smartwatch has wrist-based heart rate² and more than 15 preloaded sports apps, so you can choose how you like to get fit. Built-in GPS lets you accurately record outdoor activities.

    Get the SDK today!

    Connect IQ 2.4.8 Now Available!

    $
    0
    0

    Connect IQ 2.4.8 is here! We have added support for the Edge® Explore. This easy-to-use GPS cycling computer features a preloaded Garmin Cycle Map that shows you the routes cyclists like to ride. A variety of connected features lets you stay in touch with other riders as well as the folks back home.

    From a Connect IQ perspective, the Edge Explore has the same screen resolution and fonts as the Edge 1000 but does not support power, shifting, or downloadable workouts. If you support the Edge 1000 and do not use those features, you can add support for the Edge Explore by simply adding support in the manifest editor.

    Get the SDK and build your app for the Edge Explore today!

    Using Map Views in Connect IQ 3.0

    $
    0
    0

    Garmin built itself as a company by making location aware products, and has grown to make products that serve automotive, aviation, marine, fitness, and outdoor markets. A cornerstone to location awareness is digital cartography. Garmin products are often used outside of cell coverage, and our users depend on us to know where you are even when disconnected from the cloud. For over a decade Garmin has been digitizing the world and putting maps on devices of all shapes and sizes.

    With the addition of MapView objects, Connect IQ now allows your apps to take advantage of the digital cartography included on Garmin devices. You can use MapView objects to provide location context to the user, provide a preview of a course or route, or let the user browse their surroundings.

    Integrating Map Views

    Let’s talk through a common use case on Garmin devices. Assume the use case where you have a cloud database of routes that the user can choose to download to the device. You want to give the user a preview of the route on the map and give a clear call to action to the user to download. You also want to allow the user to touch the map to browse the route.

    Setting The Scene

    The first thing you need to do is tell the map where on the Earth you want to focus the user’s attention. The method setMapVisibleArea allows you to set a bounding box of Location objects that define what part of the world should render on screen.

    Overlaying Content

    MapView objects allow for two kinds of overlays: markers and polylines. A MapMarker instance represents a single location on the map. You can use either the default Garmin pin, or you can provide your own BitmapResource object. If you use a custom marker, you need to set the pixel that will be drawn at the exact location (the hotspot). If you pass an array of MapMarker objects to the MapView instance, it will add all of them to the map. Calling setMapMarker will clear whatever markers are currently set.

    A MapPolyline instance represents a series of coordinates, like a course. You can set the width and color of the polyline. You can set the polyline for a MapViewusing setPolyline. A MapView instance can only have one MapPolyline instance set at any given time.

    Preview and Browse

    Going back to our example, remember that we want to allow the user to have a preview of the route with a call to action, but let them browse the content if they want a closer look. The MapView class handles both use cases in a single View using the map mode.

    In MAP_MODE_PREVIEW the map view centers on an area. You can add a layout above the map with buttons and selectables to provide context and actions. You can use setScreenVisibleArea to communicate to the MapView instance what portion of the map is not obscured by your user interface.

    Switching the map mode to MAP_MODE_BROWSE changes the map view to a browse interface. The browse interface will be same browse interface used natively by the device.

    Tying it Together

    We want to show the user a preview of the course we want to download before they download it, but how can we show it before we download the full course? One way to bring a polyline to your app is with a Google Polyline Algorithm Format. This allows you to send a polyline to your Connect IQ app as a string that can be decoded back into a polyline. The function below will decode a polyline string into an array of Location objects. To conserve memory, it will begin skipping over coordinates as the polyline grows in size, essentially downscaling the line as it grows in length.

        // Constant used to downscale detail as
        // line grows in length to conserve memory
        const MAX_POLYLINE_OBJECT_COUNT = 233;
    
        // Returns the decoded polyline string
        // in an array of longitudes and latitudes
        function decodePolyline(polyline) {
            polyline = polyline.toCharArray();
            var len = polyline.size();
            var indexJump = Math.ceil(len / MAX_POLYLINE_OBJECT_COUNT);
            var poly = [];
            var index = 0;
            var lat = 0;
            var lng = 0;
            var skipIndex = 0;
    
            while (index < len) {
    
                var byte = 0;
                var shift = 0;
                var result = 0;
    
                do {
                    byte = polyline[index].toNumber() - 63;
                    result = result | ((byte & 31) << shift);
                    shift += 5;
                    index++;
                } while (byte >= 32 && index < len);
    
                var dlat = ((result & 1) ? ~(result >> 1) : (result >> 1));
    
                shift = 0;
                result = 0;
    
                do {
                    byte = polyline[index].toNumber() - 63;
                    result = result | ((byte & 31) << shift);
                    shift += 5;
                    index++;
                } while (byte >= 32 && index < len);
    
                var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));
    
                lat += dlat;
                lng += dlng;
    
                if (indexJump == 0 || skipIndex % indexJump == 0) {
                    var p = new Position.Location({:latitude=>lat/1e5, :longitude=>lng/1e5, :format=>:degrees});
                    poly.add(p);
                }
    
                skipIndex++;
            }
            return poly;
        }
    

    In our UI we want to allow the user to switch between our user interface with the call to action and allowing them to browse. Rather than pushing and popping the map view with different modes, we can use a single view and switch modes in the delegate.

    class MapSampleMapDelegate extends Ui.BehaviorDelegate {
    
        var mView;
    
        function initialize(view) {
            BehaviorDelegate.initialize();
            mView = view;
        }
    
        function onBack() {
            // if current mode is preview mode them pop the view
            if(mView.getMapMode() == Ui.MAP_MODE_PREVIEW) {
                Ui.popView(Ui.SLIDE_UP);
            } else {
                // if browse mode change the mode to preview
                mView.setMapMode(Ui.MAP_MODE_PREVIEW);
            }
            return true;
        }
    
        function onSelect() {
            // on enter button press chenage the map view to browse mode
            mView.setMapMode(Ui.MAP_MODE_BROWSE);
            return true;
        }
    }
    

    Now in a single view we can provide a UI with a call to action and preview of the course and allow the user to browse the content as well.

    Conclusion

    Hopefully you can see from this that the MapView class is a powerful addition to the Toybox. By combining Garmin digital cartography with your content, you can bring a whole new level of location awareness to your apps.

    Creating Music Apps in Connect IQ 3

    $
    0
    0

    In 2018 Garmin has launched multiple music capable wearable products that allow users to leave their phone at home while they live their active lifestyle. Users can copy their music library directly to the device, or they can install a Connect IQ audio content provider app that acts as a bridge between the wearable and a Content Delivery Network (CDN).

    Connect IQ 3 audio content providers enable third-party music services to deliver protected content. They can download content from a CDN via Wi-Fi directly to the watch, and act as a plug-in to the native media player. The content is encrypted before it reaches disk and decrypted during playback

    This post explains all the roles an audio content provider fills as well as the basics of implementation.

    Connect IQ 3.0.1 Now Available!

    $
    0
    0


    Connect IQ 3 is here! This version adds a number of new features and improvements:

    • New MapView allows you to embed map views into your Connect IQ apps.*
    • The new audio content provider apps type lets you make apps that interface with the media player. You can now make music, podcast, or other audio content apps for Garmin wearables.**
    • New Menu2 and CustomMenu provide a much richer menu framework.
    • Trial app support
    • New cryptography APIs for hashing and encryption/decryption.
    • New automatic symbol checking (ASC) checks your code for mis-typed symbols at compile time, but keeps the dynamic functionality of Monkey C
    • New onAppInstall and onAppUpdate functionality allow you run code at install time, including requesting OAUTH credentials
    • Capture beat to beat intervals using the optical heart rate sensor
    • New HTTP tracking dialog helps you debug web requests in the simulator.
    • Improvements like byte arrays, the ability to cache bitmaps in object storage, improvements to the persisted content system, and more.

    Everything is ready for you; get started today!

    * MapView available on Fenix 5X, Fenix 5 Plus family, Edge 520 Plus, Edge 820 family, and the Edge 1030 family ** Available on music capable Connect IQ devices.

     


    Connect IQ 3.0.4 Now Available!

    $
    0
    0

    Connect IQ 3.0.4 is here! Along with numerous bug fixes and improvements we have added support for a new, more powerful suite of media player UI customization APIs for music apps.

    Get the SDK to start building enhanced music apps today!

    Viewing all 89 articles
    Browse latest View live