Giter VIP home page Giter VIP logo

wear-os-samples's Introduction

Wear OS Samples Repository

This repository contains a set of individual Android Studio projects to help you get started writing Wear OS apps and watch faces.

Read below for a description of each sample.

Samples

  • AlwaysOnKotlin (Compose/Kotlin) - Demonstrates keeping the app visible in ambient mode. Note: While this is valuable for some specific use cases, most use cases won't need this, because when the watch goes into ambient mode (and shows watch face), if the user interacts with the watch again within several minutes, it will bring the app back up when it transitions out of ambient mode. Guide

  • ComposeStarter (Compose/Kotlin) - Demonstrates simple Compose for Wear OS app devs can use as a starting point for their own Compose app.

  • DataLayer (Compose/Kotlin) - Demonstrates communicating via the data layer between the watch and the phone. Guide

  • WatchFaceFormat - Demos the new Watch Face Format which allows quick development of performant watch faces in XML Guide

  • WatchFaceKotlin (Kotlin) - Demos the AndroidX Watch Face APIs which provide their own storage mechanism for watch face preference values.

  • WearComplicationDataSourcesTestSuite (Kotlin) - If you are writing a watch face with complications, this app gives you a full suite of data sources to test against your implementation of complications to make sure it looks good. Complication Guide

  • WearOAuth (Kotlin) - Demonstrates how developers can authenticate a user on their Wear OS app via the user's mobile/phone device without requiring a mobile app (Wear OS companion app handles the request on the mobile side). The sample uses OAuth. Guide

  • WearSpeakerSample (Compose/Kotlin) - Demonstrates audio recording and playback if the wearable device has a speaker. This is also an advanced Compose sample, handling permissions, use of effects, animations and ConstraintLayout for Compose. Guide

  • WearTilesKotlin (Kotlin) - Demonstrates tiles using the new AndroidX library. Guide

wear-os-samples's People

Contributors

alexvanyo avatar ataulm avatar bowersteve avatar castedmo avatar codingjeremy avatar coreflodev avatar fstanis avatar garanj avatar ggfan avatar ithinkihaveacat avatar jamie-garside avatar johnnichol avatar johnzoellerg avatar jolandaverhoef avatar kokoro-team avatar kul3r4 avatar lancelinksp avatar louiscad avatar luizgrp avatar mandnyc avatar nic0lette avatar nikit19 avatar oas004 avatar renovate[bot] avatar scott-pollom avatar shumelchyk avatar shunishii avatar slothwriter avatar yahanzhou avatar yschimke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wear-os-samples's Issues

Is TimeZoneReceiver really needed?

Issue by VladimirWrites
Saturday Jul 21, 2018 at 17:52 GMT
Originally opened as googlearchive/android-WatchFace#20


This is more of a question and not an issue.
According to the documentation onTimeTick inside WatchFaceService.Engine will be called when the time-zone is changed.
https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTimeTick()
Would it be enough to call

 mCalendar.setTimeZone(TimeZone.getDefault());
 invalidate();

inside onTimeTick() and not use BroadcastReceiver to handle the change like it's done in this project?

https://github.com/googlesamples/android-WatchFace/blob/88ae4adfabdcf3c432d957b84f6fe069b3c8ed14/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/AnalogComplicationWatchFaceService.java#L186-L193

ChannelClient Example

I wanted to use the ChannelClient to send a file and additional information (string/int information) bundled with it to a wearable. The ChannelClient seemed best for it as: 1) it saves disk space over the DataClient 2) from the wearable perspective, it is not exclusive to Android phones 3) the MessageClient does not guarantee delivery.

I can only find 2 incomplete examples of the wearable sending to the phone and both seem to use deprecated methods (GoogleApiClient and ChannelApi.OpenChannelResult). Can you add a ChannelClient example to this?

Android X migration is not complete

Issue by Elizabeth-Mezias-Bose
Wednesday Aug 14, 2019 at 22:46 GMT
Originally opened as googlearchive/android-JumpingJack#2


The MainActivity class import is using Android Jetpack.
import androidx.wear.ambient.AmbientModeSupport;

However, the build.gradle does not declare AndroidX. Instead of:
androidx.wear:wear:1.0.0

you find the following dependencies:
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
implementation 'com.android.support:support-v13:28.0.0'
compileOnly 'com.google.android.wearable:wearable:2.4.0'
implementation 'com.google.android.support:wearable:2.4.0'

That means the project won't build if you import this sample.

watch face companion app

hi,
Something is not clear to me : if you design a watch face with android studio, do you put the result in the google wear os companion app, or do you create an own companion app for your own watch faces ?
thanks
regards
ludo

Any updates?(RemoteIntent)

Hey guys, since this will be a new popular feature to add to new Wear apps would be good to update?
like Kotlin
and also RemoteIntent not found?

if (resultCode == RemoteIntent.RESULT_OK) {
ConfirmationOverlay().showOn(this@MainActivity)
} else if (resultCode == RemoteIntent.RESULT_FAILED) {
ConfirmationOverlay()
.setType(ConfirmationOverlay.FAILURE_ANIMATION)
.showOn(this@MainActivity)
} else {
throw IllegalStateException("Unexpected result $resultCode")
}

how to import a watch face from wear os companion to android studio

hi,
maybe I overlooked it, but I cannot find an explication on how to import a watch face from wear os companion app to android studio.
I just want to change the position of month/day to day/month, which seems always to be set to US , not to European format.
thanks in advance
regards

How to send broadcast when tile button is clicked?

I checked out the Wear Tiles Sample and have a question about the buttons.

The tiles media sample contains a Play icon button. As described in the sample, the buttons do not do anything at the moment. However, I am not sure how to set the click action to send a broadcast.

I would assume this play button is supposed to start the music without opening the app. I would like to do something similar, turn on a smart light without opening the app.

However, I cannot find an ActionBuilders.Action that sends a broadcast. It would be great if you could add a click action to this sample so it is clear how to actually implement a play button or something similar.

googlesamples/android-WatchFace: Build failed - Dependencies

I try to compile the project, but I get the following error

Error: Project depends on com.google.android.support:wearable:2.3.0, so it must also depend (as a provided dependency) on com.google.android.wearable:wearable:2.3.0 [GradleCompatible]

This is part of my build gradle (Application):

dependencies {
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support:support-v13:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.google.android.support:wearable:2.3.0'
compile 'com.google.android.gms:play-services-wearable:11.8.0'
compile 'com.android.support:support-v13:27.1.0'
wearApp project(':Wearable')
}

and this is part of my build gradle (Wear):

dependencies {
compile 'com.android.support:palette-v7:27.1.0'
compile 'com.android.support:wear:27.1.0'
compile 'com.google.android.gms:play-services-wearable:11.8.0'
compile 'com.android.support:support-v13:27.1.0'
compileOnly 'com.google.android.wearable:wearable:2.3.0'
compile 'com.google.android.support:wearable:2.3.0'
}

And tried with compileOnly and with provided but always shows the same error

What can I do or what am I doing wrong?
Thanks

Example for Decomposition API

Hi 👋,

I am developing and maintaining Analog Watch Face. https://github.com/VladimirWrites/AnalogWatchFace
A lot of users are asking for the second hand in ambient mode for devices using 3100+ processors, and right now it's only possible using undocumented DecompositionWatchFaceService.
I wanted to check with you if there is a plan for long-term support of Decompositions, or if some of the libraries that are currently being developed will replace its functionality.
If Decompositions are there to stay it would be great to have some documentation or examples. 😊

Resolves 'Build failed - Dependencies #17'

Issue by IceNerd
Wednesday Jul 04, 2018 at 19:56 GMT
Originally opened as googlearchive/android-WatchFace#18


Didn't review the contributing guidlines, I just fixed the thing. Pull the project and build. I was unable to track a file to add to the repo that would persist the Android Studio setting so here is another note about it!

To deploy the Application or Wearable, update the run configurations -> General -> Launch Options -> Launch: Nothing


IceNerd included the following code: https://github.com/googlesamples/android-WatchFace/pull/18/commits

Extension of dealing with broken connection between wearable- and handheld nodes

Issue by yingding
Wednesday Dec 12, 2018 at 14:16 GMT
Originally opened as googlearchive/android-DataLayer#6


Feature Request

Since sometime it is not desired to send data or messages between the wearable and handheld devices in case the (1) bluetooth/wifi connection is off on the phone, (2) watch disconnected in WearOs App, or (3) bluetooth/wifi connection is off on the watch.

The onCapabilityChanged method can be modified to catch the connection status via the available remote nodes by the given capability name. If the reachable wear nodes is empty set, than the data and message exchange can be pause to save RAM and Battery. After the connection between the nodes are reestablished, the data and message exchange shall go on.

googlesamples/android-WatchFace: Slight simplification

In the Analog Complication WatchFace sample, the ComplicationData are stored in a SparseArray, that, if I'm not mistaken, is not used anywhere. So this should be removed completely to simplify the sample.

The line where they are saved is: https://github.com/googlesamples/android-WatchFace/blob/master/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/AnalogComplicationWatchFaceService.java#L397

You can see that mActiveComplicationDataSparseArray is not used anywhere else.

iOS companion app with WearOS documentation

Are there any documented APIs that we can use to create an iOS companion app to work with WearOS watchface?
WearOS 2.0 is supposed to be compatible with Android and iOS, however there is no official documentation as to how to achieve this cross platform compatibility

Send and syncing data between mobile and watch

is it need phone and watch 's package name should be same when to send and syncing data?
when i test,
if package name is different between phone and watch,
it's can't to use data layer api to send/receive data.

uses-library present in Android manifest under the application tag bug get java.lang.IllegalStateException

 java.lang.IllegalStateException: Could not find wearable shared library classes. Please add <uses-library android:name="com.google.android.wearable" android:required="false" /> to the application manifest
        at androidx.wear.ambient.SharedLibraryVersion.verifySharedLibraryPresent(SharedLibraryVersion.java:57)
        at androidx.wear.ambient.WearableControllerProvider.getWearableController(WearableControllerProvider.java:48)
        at androidx.wear.ambient.AmbientDelegate.onCreate(AmbientDelegate.java:98)
        at androidx.wear.ambient.AmbientModeSupport.onCreate(AmbientModeSupport.java:198)
        at androidx.fragment.app.Fragment.performCreate(Fragment.java:2684)
        at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:280)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1175)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
        at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2169)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1992)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1947)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1849)
        at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2629)
        at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2577)
        at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247)
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541)
        at com.example.android.wearable.speaker.MainActivity.onStart(MainActivity.java:254)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435)
        at android.app.Activity.performStart(Activity.java:8024)
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3475)
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Slight simplification

Issue by BoD
Sunday May 13, 2018 at 12:59 GMT
Originally opened as googlearchive/android-WatchFace#16


In the Analog Complication WatchFace sample, the ComplicationData are stored in a SparseArray, that, if I'm not mistaken, is not used anywhere. So this should be removed completely to simplify the sample.

The line where they are saved is: https://github.com/googlesamples/android-WatchFace/blob/master/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/AnalogComplicationWatchFaceService.java#L397

You can see that mActiveComplicationDataSparseArray is not used anywhere else.

AAPT build error

Issue by IgorGanapolsky
Thursday Jun 27, 2019 at 22:51 GMT
Originally opened as googlearchive/android-WatchFace#25


Hello,
I am getting the following build error:

AAPT: error: duplicate value for resource 'attr/progress' with config ''.

The incremental values.xml look like this:
<declare-styleable name="SeekArc"><attr format="dimension" name="arcWidth"/><attr format="color" name="arcColor"/><attr format="integer" name="startAngle"/><attr format="integer" name="sweepAngle"/><attr format="integer|reference" name="maxProgress"/><attr format="integer|reference" name="progress"/><attr format="color" name="progressColor"/><attr format="boolean" name="roundCorner"/><attr format="color" name="thumbColor"/><attr format="dimension" name="thumbRadius"/><attr format="string" name="seekDirection"/></declare-styleable>

googlesamples/android-WatchFace: AAPT build error

Original issue created by @IgorGanapolsky in the old repo location (googlesamples/android-WatchFace):

Hello,
I am getting the following build error:

AAPT: error: duplicate value for resource 'attr/progress' with config ''.

The incremental values.xml look like this:
<declare-styleable name="SeekArc"><attr format="dimension" name="arcWidth"/><attr format="color" name="arcColor"/><attr format="integer" name="startAngle"/><attr format="integer" name="sweepAngle"/><attr format="integer|reference" name="maxProgress"/><attr format="integer|reference" name="progress"/><attr format="color" name="progressColor"/><attr format="boolean" name="roundCorner"/><attr format="color" name="thumbColor"/><attr format="dimension" name="thumbRadius"/><attr format="string" name="seekDirection"/></declare-styleable>

Update to more modern approach

Hello, thank you so much for these samples. I am learning how to build Android Wear apps thanks to these. However, can you please update your code to Kotlin and use Coroutines + Architecture Components instead of Handlers and Alarms? All these samples seem extremely outdated practices compared to IoSched and Sunflower samples which Google advocates.

Igor

WearTilesKotlin uses outdated alpha libs

Please update the demo to the latest public libs

androidx.wear.tiles:tiles:1.0.0-alpha03
androidx.wear.tiles:tiles-renderer:1.0.0-alpha03

There a huge breaking changes compared to the used old libs.
androidx.wear:wear-tiles:1.0.0-alpha01
androidx.wear:wear-tiles-renderer:1.0.0-alpha01

It's hard to understand what's the recommended implementation.

Issue while building wear apps [AlwaysOn]

I am trying to explore Wear apps after loading the Always app I get the following error

=========================
Error:No such property: GradleVersion for class: JetGradlePlugin

Consult IDE log for more details (Help | Show Log)

IDE Log errors
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2021-02-16 14:58:26,359 [se-915-b01] ERROR - ctionCallback.TimedOutCallback - Android Studio 3.0.1 Build #AI-171.4443003
2021-02-16 14:58:26,359 [se-915-b01] ERROR - ctionCallback.TimedOutCallback - JDK: 1.8.0_152-release
2021-02-16 14:58:26,359 [se-915-b01] ERROR - ctionCallback.TimedOutCallback - VM: OpenJDK Server VM
2021-02-16 14:58:26,359 [se-915-b01] ERROR - ctionCallback.TimedOutCallback - Vendor: JetBrains s.r.o
2021-02-16 14:58:26,359 [se-915-b01] ERROR - ctionCallback.TimedOutCallback - OS: Windows 7
2021-02-16 16:30:41,749 [se-915-b01] INFO - build.invoker.GradleTaskFinder - Unable to find Gradle tasks for project 'AlwaysOn' using BuildMode REBUILD
2021-02-16 16:30:41,754 [se-915-b01] INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: []
2021-02-16 16:31:18,856 [se-915-b01] INFO - ide.actions.ShowFilePathAction -
Exit code 1

Gradle version from the Project Structure is 6.5

Please let me know if you need more information/details or I am missing some plugin to build this app

idea.log
threadDump-20210216-145152.txt

googlesamples/android-WatchFace: Is TimeZoneReceiver really needed?

This is more of a question and not an issue.
According to the documentation onTimeTick inside WatchFaceService.Engine will be called when the time-zone is changed.
https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTimeTick()
Would it be enough to call

 mCalendar.setTimeZone(TimeZone.getDefault());
 invalidate();

inside onTimeTick() and not use BroadcastReceiver to handle the change like it's done in this project?

https://github.com/googlesamples/android-WatchFace/blob/88ae4adfabdcf3c432d957b84f6fe069b3c8ed14/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/AnalogComplicationWatchFaceService.java#L186-L193

WearDrawers sample using deprecated classes android.app.Fragment and android.app.FragmentManager

Please migrate these deprecated classes to use androidx classes.
android.app.Fragment = androidx.fragment.app.Fragment
android.app.FragmentManager = androidx.fragment.app.FragmentManager

I have tried to do this in my own projects and it appears to me that this sample will no longer work using classes that are not deprecated. Specifically the the NavigationAdapter for the top navigation drawer will error out from my experience. I cant seem to find any documentation about fixing this problem or I wouldn't bother you with it. Thanks.

[ISSUE][CLOSED] Is this sample still relevant ?

Issue by AmandaBeuno
Monday Feb 04, 2019 at 22:07 GMT
Originally opened as googlearchive/android-JumpingJack#1


Good day,

I opened my Android Studio->File->New->Import Sample and run the "JumpingJack" sample on my "Huawei Watch 2" but the counter remains on zero.

I tried to figure out what is not working with it on the MainActivity, but I guess it is in vein.

Hope you can give me any pointers on why this sample is not working or if it is anything wrong on my part.

All the best,

WearableRecyclerView scrollbar on square display

Issue by moneytoo
Wednesday Feb 14, 2018 at 21:01 GMT
Originally opened as googlearchive/android-WearAccessibilityApp#1


In both this sample and https://github.com/googlesamples/android-WearNotifications, Activities featuring WearableRecyclerView display scrollbar that doesn't take the full display height on watches with square displays. The height of scrollbar is the same as the height of an item. It's ok on round watches but this doesn't look right.
(I know I can tweak ScalingScrollLayoutCallback to make it look better/different but I'm not aware of anything related to the scrollbar there.)

screenshot_1518641071

The app drawer/launcher looks ok.

screenshot_1518641108

I tested it in the latest emulator though.

Build failed - Dependencies

Issue by ccruz17
Thursday May 31, 2018 at 02:01 GMT
Originally opened as googlearchive/android-WatchFace#17


I try to compile the project, but I get the following error

Error: Project depends on com.google.android.support:wearable:2.3.0, so it must also depend (as a provided dependency) on com.google.android.wearable:wearable:2.3.0 [GradleCompatible]

This is part of my build gradle (Application):

dependencies {
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support:support-v13:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.google.android.support:wearable:2.3.0'
compile 'com.google.android.gms:play-services-wearable:11.8.0'
compile 'com.android.support:support-v13:27.1.0'
wearApp project(':Wearable')
}

and this is part of my build gradle (Wear):

dependencies {
compile 'com.android.support:palette-v7:27.1.0'
compile 'com.android.support:wear:27.1.0'
compile 'com.google.android.gms:play-services-wearable:11.8.0'
compile 'com.android.support:support-v13:27.1.0'
compileOnly 'com.google.android.wearable:wearable:2.3.0'
compile 'com.google.android.support:wearable:2.3.0'
}

And tried with compileOnly and with provided but always shows the same error

What can I do or what am I doing wrong?
Thanks

Step Counter default provider isn't functional

Issue by littleariel
Sunday Feb 24, 2019 at 19:36 GMT
Originally opened as googlearchive/android-WatchFace#22


Running Google Fit 2.08.21, WearOS 2.3, and Google Play Services 15.0.90 on Ticwatch Pro, the STEP_COUNT system provider isn't working anymore.

To reproduce the issue, just add the following at the end of initializeComplicationsAndBackground()

// TEST SYSTEM PROVIDERS
// Watch battery works:
setDefaultSystemComplicationProvider(LEFT_COMPLICATION_ID, SystemProviders.WATCH_BATTERY, ComplicationData.TYPE_SHORT_TEXT);

 // Steps do NOT work (that's a bug):
setDefaultSystemComplicationProvider(RIGHT_COMPLICATION_ID, SystemProviders.STEP_COUNT, ComplicationData.TYPE_SHORT_TEXT);

When running this on the watch, the left complication shows the watch battery as expected. The right complication shows "--" for the steps instead of the daily step count, which is a bug.

I confirmed the Google Fit app shows non-zero steps on the watch. Note that going into the watch face configuration activity and explicitly replacing the default step count with the Google Fit step count works and shows the right value.

googlesamples/android-WatchFace: Step Counter default provider isn't functional

Running Google Fit 2.08.21, WearOS 2.3, and Google Play Services 15.0.90 on Ticwatch Pro, the STEP_COUNT system provider isn't working anymore.

To reproduce the issue, just add the following at the end of initializeComplicationsAndBackground()

// TEST SYSTEM PROVIDERS
// Watch battery works:
setDefaultSystemComplicationProvider(LEFT_COMPLICATION_ID, SystemProviders.WATCH_BATTERY, ComplicationData.TYPE_SHORT_TEXT);

 // Steps do NOT work (that's a bug):
setDefaultSystemComplicationProvider(RIGHT_COMPLICATION_ID, SystemProviders.STEP_COUNT, ComplicationData.TYPE_SHORT_TEXT);

When running this on the watch, the left complication shows the watch battery as expected. The right complication shows "--" for the steps instead of the daily step count, which is a bug.

I confirmed the Google Fit app shows non-zero steps on the watch. Note that going into the watch face configuration activity and explicitly replacing the default step count with the Google Fit step count works and shows the right value.

RemoteIntent not found error

Issue by andrew-codechimp
Tuesday Jan 09, 2018 at 10:21 GMT
Originally opened as googlearchive/android-WearVerifyRemoteApp#2


When trying to use this sample I'm getting errors trying to resolve Remote Intent

error: package com.google.android.wearable.intent does not exist
error: cannot find symbol variable RemoteIntent

I'm getting the same on my own project which implemented this as well, updating all dependencies to the latest versions didn't resolve the issue either.

Not able to view Wear App on the playstore

  1. created a release version of the mobile app [which has an embedded wear apk]
  2. on the successful installation of the mobile app, the wear app should appear on the Wear PlayStore .but it's not showing.

I can see the wear app on Wear OS by Google on 2.24 but not 2.27
FYI: I had tried running RuntimePermissionWear sample and the issue is happening with my app as well
I even analyzed the Mobile Apk and I can the micro_wear apk embedded in it.
Any help will be appreciated.
Thank you in advance

constrainCircle + setRotation in wearOS

Trying to use a constrainCircle in wearOS app along with a rotation using the new ConstraintLayout library. For some reason, the element rotates fine however the constrainCircle is not working.

        @Override
        public void run() {
            xAnimation = animateForGivenTime(TimeUnit.SECONDS.toMillis(40));
            xAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator valueAnimator) {
                    int degrees = (Integer) valueAnimator.getAnimatedValue();
                    constraintSet.constrainCircle(R.id.textView1, R.id.center,
                            50,
                            degrees);
                    constraintSet.setRotation(R.id.textView1, degrees);
                    constraintSet.applyTo(constraintLayout);
                    invalidate();

                }
            });


            xAnimation.start();
        }
    });```


Is there some compatibility issues with the constrainCircle function with wearOS? Or did I miss something crucial?

XYZ Tourist Attractions can't be installed on wear device

I am getting this while trying to deploy the weareable module on my watch. "Warning: The activity must be exported or contain an intent-filter". I searched the internet and added this: <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> to AndroidManifest.xml but that deployed weird app that looks like the handheld one and doesn't feel like weareble compatible. The deployment guides didn't really helped with this issue.

Tile not available in the Release Build

If matched the tile example and got my tile previewed the the preview Activity. It all looked good so I published it, but the tile does not show up in the list of available tiles.

Here is my manifest service:

        <service
            android:name=".provider.StorageProviderService"
            android:label="NavExplorer"
            android:description="@string/tile_description"
            android:icon="@mipmap/ic_launcher"
            android:permission="com.google.android.wearable.permission.BIND_TILE_PROVIDER">
            <intent-filter>
                <action android:name="androidx.wear.tiles.action.BIND_TILE_PROVIDER" />
            </intent-filter>

            <meta-data android:name="androidx.wear.tiles.PREVIEW"
                android:resource="@drawable/tile_preview" />
        </service>

Is there another step required?

Added an example of handling remote wear nodes not reachable for the handheld device

Issue by yingding
Wednesday Dec 12, 2018 at 13:38 GMT
Originally opened as googlearchive/android-DataLayer#5


Since sometime it is not desired to send data or messages between the wearable and handheld devices in case the (1) bluetooth/wifi connection is off on the phone, (2) watch disconnected in WearOs App, or (3) bluetooth/wifi connection is off on the watch.

onCapabilityChanged method is modified to check if there are active reachable wearable remote nodes. In case the connection between the watch and phone is broken through case (1),(2),(3) no more data and messages are sent among the devices. After the connection is reestablished, the data and message exchange is going on again.


yingding included the following code: https://github.com/googlesamples/android-DataLayer/pull/5/commits

Cannot resolve symbol 'RemoteIntent' for WearVerifyRemoteApp

I followed the example to use RemoteIntent, but have run into a problem I cannot seem to get past.

I have this import in my class:
import com.google.android.wearable.intent.RemoteIntent;

But am getting an error:

Cannot resolve symbol 'RemoteIntent'
The red lightbulb recommendation is to:

Add Library 'Gradle: com.google.android.support:wearable:2.8.1@aar' to classpath
But when I click on it nothing happens.

And this line in my mobile app gradle dependencies:

compileOnly 'com.google.android.wearable:wearable:2.8.1'
What am I doing wrong?

When I try to build I get this error:

package com.google.android.wearable.intent does not exist error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.