Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test Android Wear apps on phone?

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.

like image 843
Chad Schultz Avatar asked May 05 '15 21:05

Chad Schultz


People also ask

Can you run Android apps on Wear OS?

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.

How do I connect my Android Wear emulator to my phone?

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.

What does the Android Wear app do?

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.


1 Answers

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.

like image 52
gruszczy Avatar answered Sep 18 '22 23:09

gruszczy