Interestingly enough, I noticed that when developing, I can choose to run a Wear app on the phone instead of a Wear device. It looks the same--just huge, of course.
Based on https://plus.google.com/+AndroidDevelopers/posts/QhWQArNDfS3, I gather I could use ADB to make the phone screen small enough to do a fair imitation of a rectangular smartwatch...
But what about testing for round Android Wear devices? Is there something I can do to the phone (or a rectangular Android Wear device, for that matter) to make it show as a circle (and even better, identify as a round device to Android Wear) in order to test the round interfaces?
Yes, there's always cutting a round hole out of a page and holding that over the device, but that's obviously far from ideal.
You can get apps and games for your Wear OS watch from the Google Play Store. Tip: To use apps from the Play Store, your watch must run Wear OS 2 or newer. Learn how to check your watch version.
On the phone, in the Wear OS app, tap the Overflow button, and then tap Pair with Emulator. Tap the Settings icon. Under Device Settings, tap Emulator. Tap Accounts and select a Google Account, and follow the steps in the wizard to sync the account with the emulator.
Android Wear features such as using your smartwatch as an activity tracker, setting alarms and checking the time work without being paired with your phone. Plus, you can easily manage many of its settings on your phone.
You can test your app on a round emulator. Here are instructions how to do this: https://developer.android.com/training/wearables/apps/creating.html
EDIT: About round and forcing round on a square device: you can try to pretend that the device is round, but it's a little hacky and ugly.
In your Activity
you need to implement inset listener and then use reflection to change WindowInsets.mRound
field. Then dispatch the insets further down the hierarchy. This will trick your views to think that the device is round.
Check this article about handling square and round: http://gruszczy.blogspot.com/2015/03/handling-round-screens-using.html It describes how insets with the information about device display type are delivered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With