wear-os

Group notifications on a wearable from the micro app

拟墨画扇 提交于 2019-12-01 11:15:15
I build a micro app for a wearable now I'm working with notifications on the device. Here is my example code: NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setContentTitle(title) .setContentText(message) .setSmallIcon(icon) .setGroup(groupKey); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); notificationManager.notify(id, builder.build()); This notification is never shown and it does not matter if I have one or multiple notifications with the same group key. Do you know what I'm doing wrong? Just for clarification I

Trying to send data from Android Tablet to Android Wear device and losing

血红的双手。 提交于 2019-12-01 10:59:48
问题 I could really use some help. I'm having trouble getting my Android Wear device to recognize data changes made by my activity that runs on my Android tablet. I'm relatively new to Android and very new to the Wear APIs so I might be missing something completely obvious or trivial without realizing. I've pieced together a project from a couple of examples from the Android Wear doc pages and from the TwoToasters example on github. I just want to get data communication set up between the devices

Using Data API changes to update watch face UI

守給你的承諾、 提交于 2019-12-01 10:58:29
I'm using the Data API in a service for Android Wear in a watch face that pulls down data from the cloud in a phone app and syncs it through a DataMap to the paired watch app. But I'm a bit lost on how to get the service on the wearable side to properly listen to updates AND redraw its UI. Should I be doing this all from the same service? I tried implementing the DataApi.DataListener methods in the private internal class that extends CanvasWatchFaceService.Engine, but that doesn't seem to work. @Override public Engine onCreateEngine() { return new Engine(); } private class Engine extends

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-01 10:44:14
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:/.../wear/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project

Animate rotation of an image in Android

与世无争的帅哥 提交于 2019-12-01 10:40:57
I have a gear image which I want to continuously rotate about a fixed point. Earlier I was accomplishing this by including the image in my Android class as an ImageView and applying a RotateAnimation to it. @InjectView(R.id.gear00) ImageView gear00; RotateAnimation ra07 = new RotateAnimation(0, 359, 129, 186); ra07.setDuration(10000); ra07.setRepeatCount(RotateAnimation.INFINITE); ra07.setInterpolator(new LinearInterpolator()); gear00.setAnimation(ra07); Basically, I was injecting the ImageView into the class and applying a rotation animation. However, I dont have the luxury of using an

Group notifications on a wearable from the micro app

穿精又带淫゛_ 提交于 2019-12-01 09:40:50
问题 I build a micro app for a wearable now I'm working with notifications on the device. Here is my example code: NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setContentTitle(title) .setContentText(message) .setSmallIcon(icon) .setGroup(groupKey); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); notificationManager.notify(id, builder.build()); This notification is never shown and it does not matter if I have one or multiple

Using Data API changes to update watch face UI

限于喜欢 提交于 2019-12-01 09:07:54
问题 I'm using the Data API in a service for Android Wear in a watch face that pulls down data from the cloud in a phone app and syncs it through a DataMap to the paired watch app. But I'm a bit lost on how to get the service on the wearable side to properly listen to updates AND redraw its UI. Should I be doing this all from the same service? I tried implementing the DataApi.DataListener methods in the private internal class that extends CanvasWatchFaceService.Engine, but that doesn't seem to

Android Wear - Notification - setContentAction() not working

筅森魡賤 提交于 2019-12-01 05:45:34
I'm creating a notification that fires from the wearable device and only on the wearable device, not on phone at all. I want it to have two action buttons (no functionality yet) and a third action when the notification itself is clicked. I'm trying to use setContentAction() to make the last action be the action when the notification is clicked, but it's still displaying as a separate action button (according to the documentation here it shouldn't display a separate button). That unwanted button fires the desired intent, though. The notification itself isn't responding to clicks. Here is the

Compiling simple wearable app in Android Studio - WatchActivity not found

北城余情 提交于 2019-12-01 05:39:47
I followed the instructions at this link to create a simple mobile/wearable app in Android Studio. However, it won't recognize any of the classes specific to the wearable SDK, giving the error "cannot resolve symbol ______ ". The screenshot at this link is what I am seeing. The following is my build.gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 20 buildToolsVersion '20.0.0' defaultConfig { applicationId 'com.example.lsykora.androidwearwidget' minSdkVersion 'L' targetSdkVersion 'L' versionCode 1 versionName '1.0' } buildTypes { release { runProguard false

Android Wear - Notification - setContentAction() not working

試著忘記壹切 提交于 2019-12-01 03:34:02
问题 I'm creating a notification that fires from the wearable device and only on the wearable device, not on phone at all. I want it to have two action buttons (no functionality yet) and a third action when the notification itself is clicked. I'm trying to use setContentAction() to make the last action be the action when the notification is clicked, but it's still displaying as a separate action button (according to the documentation here it shouldn't display a separate button). That unwanted