Coder Social home page Coder Social logo

Comments (7)

yschimke avatar yschimke commented on July 22, 2024

cc @garanj I wonder if it's useful for other apps.

from horologist.

Tolriq avatar Tolriq commented on July 22, 2024

@yschimke the 100 000$ question is about the battery usage of BT vs wifi, in the doc you suggest no BT for more that 1 Mb. But is there any data to help justifying that the gain is so huge it can be beneficial for maybe a little lower sizes too. (For the cases that do not care about speed of course).

from horologist.

yschimke avatar yschimke commented on July 22, 2024

These are just guides. They are written to be fairly black and white, to ensure that most apps just do the safe/optimal thing. But if you have a specific case, such as needing particular network access, then you can make an educated call and check it isn't draining the battery super fast.

from horologist.

Tolriq avatar Tolriq commented on July 22, 2024

Well in my case the need is to transfert large amount of data from the phone to the watch in the most efficient way possible battery wise. Speed would be nice but probably secondary. So I don't have a particular network need, if BT is battery efficient to transfert 500Mb+ of data then it's ok for me. The docs seems to imply wifi would be best for battery hence this request.

from horologist.

yschimke avatar yschimke commented on July 22, 2024

There are two issues with BT for this

  1. It's going to be slower, you'll keep the app awake longer running the copy, than if you got it straight via Wifi.
  2. BT is a shared resource, you'll saturate the connection, and other things between the watch and notification could be delayed.

But they are very different APIs also.

I don't know to treat the BT connection as a socket to the mobile. So it's Data Layer APIs unless you have more information.

from horologist.

Tolriq avatar Tolriq commented on July 22, 2024

From the doc I would have do the ChannelClient way as it seemed to be the solution to that and tried to build some kind of channel that would go through Wifi. This part of wear is new to me and there's little doc about it. And horologist all nice stuff is about downloading from internet.

On another Wear app without such constraints I use DataClient but this does not fit this need at all.

Edit: But in all cases thanks for the confirmation that I should not try to achieve that via BT :)

from horologist.

capntrips avatar capntrips commented on July 22, 2024

I'm trying to do something similar and came across this. After reworking the DataLayer sample to use ChannelClient, it unfortunately continues to use Bluetooth, so I tried using raw sockets in Ktor. A 500mb file, which was on target to take just under an hour to transfer over Bluetooth via ChannelClient, took just under two minutes to transfer over Wifi via Ktor. Rather than completely redoing everything, I imagine I'll just end running Ktor as an HTTP server and dynamically generating the JSON files.

from horologist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.