Giter Club home page Giter Club logo

android-watchface's Introduction

Android WatchFace Sample

This repo has been migrated to github.com/android/wear-os. Please check that repo for future updates. Thank you!

android-watchface's People

Contributors

codingjeremy avatar google-automerger 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

android-watchface's Issues

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

Issues

I want to create this project then here show the problem that this project isn't having launcher activity for this project. so please solve this manifest file please.

Play Services Fitness is v8.3 where Play Services Wearable is set to v8.4

When trying to run this project on either my phone or wear device, I was receiving this error:

Error:Execution failed for task ':Application:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

Initially I thought the solution was going to be solved by setting multiDexEnabled to true, but then I found in the build.gradle files for both the Application and Wearable, Play Services Fitness and Wearable are compiling different versions:

    compile 'com.google.android.gms:play-services-fitness:8.3.0'
    compile 'com.google.android.gms:play-services-wearable:8.4.0'

I'd like to submit a pull request to make it so both use v8.4.

AAPT build error

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>

Error:(11, 38) error: package com.google.android.gms.fitness does not exist

Hi,
I download the source code and rebuild project in Android studio 2.3.2.
But I get the following error message:
C:\Users\Hank\Desktop\android-WatchFace-master\Application\src\main\java\com\example\android\wearable\watchface\FitDistanceWatchFaceConfigActivity.java
Error:(11, 38) error: package com.google.android.gms.fitness does not exist
Error:(81, 25) error: cannot find symbol variable Fitness
Error:(80, 25) error: cannot find symbol variable Fitness
Error:(79, 25) error: cannot find symbol variable Fitness
Error:(213, 58) error: package Fitness does not exist
Error:Execution failed for task ':Application:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

I buid this sample code with Android SDK 25 and Android Build Tools v25.0.3.
Does anyone know how to resolve this error?
Thanks!

Best regard,
Hank

Project wont build.

I just pulled this project and tried to compile it from revision 5974a4e with ./gradlew build. Unfortunately it never succeeds no matter how many times I try things like clean and so on. The error is:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpk;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)

Google Fit connexion not working

Hi!
I tried to enable the Google Fit switch in distance sample watch face, it showed me the account picker, but then, the switch disables itself, and nothing more, although that I've Google Fit on my phone (and I use it).

I got this problem on my LG G Watch C670 on Build LCA43, with Android Wear 1.3.0.2160025 and Google Play Services 8.3.01 (2385995-534). The watch also says that it's running Android 5.1.1. My phone is a Moto X 2nd Gen (2014), running Android 5.1

import error

FAILURE: Build failed with an exception.

  • What went wrong:
    Task '' not found in root project 'watchface-template-master'.
  • Try:
    Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

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.

can't get the code to run

hello!
when i open the project and try to get them running in android studio, it always shows the error info "no default activity".
then i tried to set default activity but only FitDistance worked well, others failed with info like
"""
FATAL EXCEPTION: main
Process: com.example.android.wearable.watchface, PID: 14693
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.wearable.watchface/com.example.android.wearable.watchface.DigitalWatchFaceCompanionConfigActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.ComponentName.getClassName()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2678)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
at android.app.ActivityThread.access$800(ActivityThread.java:187)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1582)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5844)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1109)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.ComponentName.getClassName()' on a null object reference
at com.example.android.wearable.watchface.DigitalWatchFaceCompanionConfigActivity.onCreate(DigitalWatchFaceCompanionConfigActivity.java:77)
at android.app.Activity.performCreate(Activity.java:6190)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1115)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2625)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758) 
at android.app.ActivityThread.access$800(ActivityThread.java:187) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1582) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5844) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1109) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875) 
"""
im so confused, please help me with the problem.
thank you!!

Sample Custom Watch Faces do not show up in Android Wear App

After importing the project to Android Studio (1.0.2), run the Wearable on Nexus 5 (5.0.1). Android Studio doesn't report any error, however the sample custom faces do not show up in Android Wear App (with Moto 360 on 5.0.1).

Other downloadable custom watch faces from Google Play exist in Android Wear App.

No wearable device is currently connected

I get this error when opening the companion app on the phone. Watchface on the real watches is installed and selected. Watches and phone are paired correctly. All other applications work correctly. The problem is only with this sample app. What is the reason?
photo5287742608900205275

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.

14:24 Error running 'Wearable': Default Activity not found

I tried to run The code on my watch.
but It display this error.
"14:24 Error running 'Wearable': Default Activity not found".
Why ?

  1. Watch is enable Development mode.
  2. USB connect with watch and my PC.
  3. With android studio, I click "Run Wearable".

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

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.