How To Get Dimensions Of A Connected Android Wear Device For Making Bitmaps Smaller?
Solution 1:
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:)
Solution 2:
The documentation states, that the background images should be 640x400px if you want parallax effect or 400x400px if you don't want it.
Post a Comment for "How To Get Dimensions Of A Connected Android Wear Device For Making Bitmaps Smaller?"