Ktor Client Engine for Karoo

Comments

6 comments

  • Avatar
    timklge

    Great idea, thanks for posting it.

    I recently implemented a simple OAuth client that uses the KarooSystemService's http api for an extension. Using the proven Ktor (oauth) library via your client engine sounds like the better approach that requires less code, so I'll probably switch.

    1
    Comment actions Permalink
  • Avatar
    Jonas Franz

    @timklge I'm currently using it for OAuth too, works well so far. The only limitations I came across are that the request and response is limited to 100 KB by the Karoo System Service and for OAuth2 that the authorization takes place in the browser which does not use the bluetooth connection. 

    0
    Comment actions Permalink
  • Avatar
    timklge

    I also encountered the issue with the browser not using the Bluetooth connection, but transferring responses bigger than 100 KB seems to work fine.

    However, it is slower than I hoped for and not designed for interactivity. I prototyped an extension that uses the spotify web api to provide media player controls, and all requests tunneled through the companion app take more than 2 seconds, often about 5. Transferring a 70 KB 300x300 JPEG thumbnail takes up to 20 seconds, during which no other http requests go through because they are processed sequentially.

    0
    Comment actions Permalink
  • Avatar
    Jonas Franz

    lol, I‘m currently doing the same thing (spotify)

    0
    Comment actions Permalink
  • Avatar
    timklge

    Nice, I've pushed my current state to github at https://github.com/timklge/karoo-spotify and was hoping to reach a stable state within a few weeks, and then submit it to Spotify for review so that oauth works for all users.

    Unfortunately, both approaches I've tried so far (web api, spotify android sdk with spotify sideloaded directly sideloaded onto the Karoo) do have their downsides. Volume control via web api is not possible for android and iOS devices :(

    0
    Comment actions Permalink
  • Avatar
    Jonas Franz

    Maybe we can exchange ideas? Feel free to contact me :) (see github.com/jonasfranz)

    0
    Comment actions Permalink

Please sign in to leave a comment.