wear-os

Android wear WearableListView ImageView selector

梦想与她 提交于 2020-01-01 15:07:07
问题 I am trying to create a list view as follows:- Now, I have made the list view work successfully using the WearableListView adapter. However, I am using static images in the ImageView. What I want is to create this gray and blue kind of animation when a particular list element is focused while scrolling. How do I do that? I tried using a selector xml file for the ImageView but it seems this ListView doesnt make use of this selector(android:state-focused, selected, pressed-nothing works). Any

Long Running Apps on Android Wear

旧巷老猫 提交于 2020-01-01 12:09:08
问题 The Android Wear ecosystem seems to be built around quick tasks which a user will interact with, and then close. This works great for most applications, but what about one which covers a long running task, and should not be automatically closed when the watch sleeps? My specific case: Swing by Swing Golf GPS. The preferred operation would be to have the application remain active, and shown when the screen wakes due to user action. And the life-time of a single use will be between 2 to 4 hours

BoxInsetLayout doesn't work

∥☆過路亽.° 提交于 2020-01-01 10:12:32
问题 I created sample android wear activity project in android studio v1.2.2. I deleted WatchViewStub and used this example to create activity with BoxInsetLayout. But BoxInsetLayout doesn't work correctly on Round Device. And I tested this on moto 360 android 5.1.1 and before update on moto 360 version 5.0.1. And I tested this on emulator. And It doesn't work at all. All time I see this: but must be this My code below: activity_main.xml <android.support.wearable.view.BoxInsetLayout xmlns:android=

BoxInsetLayout doesn't work

狂风中的少年 提交于 2020-01-01 10:12:09
问题 I created sample android wear activity project in android studio v1.2.2. I deleted WatchViewStub and used this example to create activity with BoxInsetLayout. But BoxInsetLayout doesn't work correctly on Round Device. And I tested this on moto 360 android 5.1.1 and before update on moto 360 version 5.0.1. And I tested this on emulator. And It doesn't work at all. All time I see this: but must be this My code below: activity_main.xml <android.support.wearable.view.BoxInsetLayout xmlns:android=

Programmatically determine screen shape in Android Wear

99封情书 提交于 2020-01-01 05:37:04
问题 I'm looking for a technique to determine in Java if the Android Wear device screen is round or rectangular. Note that this isn't just about layouts; my code actually needs to know which shape it's working with, because they're handled differently. As far as I can see from code samples online, two different approaches should be possible - but I've been unable to get either of them to work. I'll include them here to eliminate them from the running, or for possible troubleshooting (if anyone can

Android Wear Specific Notification

泄露秘密 提交于 2020-01-01 04:24:28
问题 The WearableNotifications.Builder setLocalOnly method can be used for displaying a notification on a phone only, and not mirror it to a Wear device. Is there a way to do the opposite, so creating a notification that will display only on the Wear device? 回答1: Actually you can do it using .setMinPriority() on the wearable notification (while it's not official, it works for now) Notification summaryNotification = new WearableNotifications.Builder(builderG) .setGroup(GROUP_KEY_MESSAGES,

Android Wear app resulting in getGoogleAppId failed with status error

99封情书 提交于 2019-12-31 13:24:06
问题 I have an Android Wear app which was working fine on my Moto360. It access Google Play Services and GCM APIs in the Google Admin console. Then I tried to use another watch (LG G Watch). Because I can only pair one watch at any time with my phone, I had to "forget" the moto360 in order to pair with the LG G Watch. Now I cannot seem to connect to Google App API (GCM or play services). I am getting the following error: I/GMPM ( 2746): App measurement is starting up E/GMPM ( 2746): getGoogleAppId

Android Wear app resulting in getGoogleAppId failed with status error

让人想犯罪 __ 提交于 2019-12-31 13:22:33
问题 I have an Android Wear app which was working fine on my Moto360. It access Google Play Services and GCM APIs in the Google Admin console. Then I tried to use another watch (LG G Watch). Because I can only pair one watch at any time with my phone, I had to "forget" the moto360 in order to pair with the LG G Watch. Now I cannot seem to connect to Google App API (GCM or play services). I am getting the following error: I/GMPM ( 2746): App measurement is starting up E/GMPM ( 2746): getGoogleAppId

When using compile 'com.google.android.support:wearable:2.0.4' I get the error below, but I am not using 26.0.0

时光毁灭记忆、已成空白 提交于 2019-12-30 11:16:27
问题 When using compile 'com.google.android.support:wearable:2.0.4' (the latest version of com.google.android.support:wearable ) in my Wear app's build.gradle file, I get the error below, but I am not using 26.0.0. What should I do? Even if I add compile 'com.android.support:wear:26.0.0' it still fails. Error in the project's gradle file: Error:(22, 13) Failed to resolve: com.android.support:wear:26.0.0 <a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:/...

Requesting permissions on Android wear

限于喜欢 提交于 2019-12-30 05:23:18
问题 I have written an application that takes advantage of system_alert_window on android wear. Since marshmallow this permission is revoked by default. I have enabled this permission on the phone side app from the phone settings. But the permission is still denied on the android wear side app and causes the android wear side app to crash with permission denied exception. Is there a way to enable this permission on Android wear side? 回答1: Short answer: keep your watch app on targetSdkVersion 22.