How to get dimensions of a connected Android Wear device for making bitmaps smaller?
Asked Answered
O

2

0

I would like to resize large images for connected Android Wear device. I don't want to transmit large images over Bluetooth. Is there some generic way? I don't want to hardcode screen size for a specific device.

Overissue answered 25/7, 2014 at 13:43 Comment(0)
O
0

The documentation states, that the background images should be 640x400px if you want parallax effect or 400x400px if you don't want it.

Overissue answered 26/12, 2014 at 14:20 Comment(0)
L
0

If you want such kind of optimizations you can ask particular device for a configuration (resolution etc.)

For the communication you can use one of WearableApi:
https://developer.android.com/training/wearables/data-layer/index.html

Either DataApi or MessageApi.

But I think you should use MessageApi in that case.
You will need to send a configuration from Watch to your Phone and then store it on Phone. From my test I can tell that nodeId appears to be constant [confirmation needed] - even after reboots. Your Phone will need to ask for the configuration only once and store this configuration (associated to sender's nodeId) for later use.
Then if you're about to send a bitmap to a connected Node, you need just to read it's configuration (stored locally) and resize that bitmap to appropriate size:)

Lieutenant answered 25/7, 2014 at 21:12 Comment(2)
Thanks, I know about this manual way. I was wondering if there is something baked in into the framework. I have a feeling that I saw it somewhere during I/O talk/video, but I can't find it.Appeasement
I cannot recall anything like that from Google I/O :( I think there is no such thing. However I think it's not a big deal when nodeId appears to be constant, so read once - use any time later.Bluefield
O
0

The documentation states, that the background images should be 640x400px if you want parallax effect or 400x400px if you don't want it.

Overissue answered 26/12, 2014 at 14:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.