FORUMS
Remove All Ads from XDA

CASUALWear Watchface [FOSS] [Analog & Digital]

5,226 posts
Thanks Meter: 9,880
 
Post Reply Email Thread
Hi guys,

Rumor on the street has it that there is no API for making watchfaces.. Well, that's just plain wrong. I've been working with Daniel "Master of Time" Ortiz, aka @kuronosan. We've worked out a ton of the details in order to make watchface APKs easy! It's as simple as making some png resources and then putting code behind them. You just need a framework and that framework is right here! We are going to squash that "no API" rumor here and now. We've not only got the APis here, we've added nice things like transitions which you won't find on many of the other watches!




What's it all about?
This package consists of 2 major parts, the Mobile App, and the Wear App.

mobile app
The mobile app's job is to deploy the Wear app and provide an icon/view which gets installed in the app drawer, allowing the user easy access to uninstallation. After the Wear "MicroApp" App is deployed, this application serves little function. Its a little funny as the MicroApp is much larger than the primary app due to resources

Wear App
The Wear App has two entirely different activities built into it; Analog and Digital. Wear applications are basically live wallpapers. They use the Background Provider permission and they have a few additional properties such as the need to react to the DisplayManager's Screen On, Screen Dim and Screen Off commands. Aside from this, they are simply eye-candy.


Digital
The Digital section of this watch was written entirely from scratch by yours truely. I found that the animations involved in watchfaces can bloat an activity significantly. So, I use Java Inheritance to extend the classes in order to logically separate things in this way
  1. DigitalWatchfaceActivity - Handles setting up the views and intent receivers for date/time/battery and updating the time
  2. DigitalWatchfaceActions - Handles PowerManager commands and aesthetic elements such as animations/transitions.
  3. DigitalWatchfaceApp - Used to launch the activity, reserved for future use.

Analog
Watchface-Gears has provided an awesome starter for Analog Watches. Rather than reinvent the wheel, we've used their base. I had to rework a considerable chunk to add in fading transitions and refactoring for analog/digital separation. When all was said and done, between mine and Daniel Ortiz's work, the only thing that's original is Watchface-Gears library. We kept Watchface-Gears in tact because it is an awesome library. It also set the license used throughout the project. (Apache)

How do I make my own?
Here's how you get started. Being that this is mostly artwork, I can't tell you "how" to do it... But, I can do what to do.
  1. Download the source.
  2. Load it into Android Studio
  3. Modify the package name suffix (watchface/gradle.properties: currentApplicationIdSuffix=MyCustomWatchName), and make it unique string, so when you generate a signed APK it doesn't collide with mine or others. Better yet, you should rename the entire package but that is a detailed operation.
  4. Modify both the Mobile and Wear (watchface/wear/src/main/AndroidManifest.xml & watchface/mobile/src/main/AndroidManifest.xml) files to rename the watch faces and app names for the Wear Picker.
  5. Build the package now to verify it works after you've changed properties.
  6. If you want to customize the Analog watchface app, all you need to do is modify the PNGs in watchface/wear/src/main/res.
  7. If you want to customize the Digital watchface app, you will rework both the wear/src/main/res/layout/digital_watch_layout_awake.xml and the wear/src/main/res/layout/digital_watch_layout_dim.xml. These are standard Android XML layouts.
  8. If you don't want to use the Analog or Digital, remove the AnalogWatchfaceActivity's or DigitalWatchfaceActivity's <activty> entry from watchface/wear/src/main/AndroidManifest.xml
  9. When you're done with the layouts, update the PNG files in watchface/wear/src/main/res/drawable with screenshots for the Background Provider picker (shown near the bottom).
Get creative!


CASUALWear Images
see attached images

Transitioning through Background Providers:


See attachments

Downloads and Source
You can get source here: https://github.com/adamoutler/watchface
Download it free here: https://play.google.com/store/apps/d...LWatch.release
Get the donate version and give me an excuse for my wife here: https://play.google.com/store/apps/d...ev.CASUALWatch
Attached Thumbnails
Click image for larger version

Name:	device-2014-11-02-121914.png
Views:	16856
Size:	18.0 KB
ID:	2996667   Click image for larger version

Name:	device-2014-11-02-121444.png
Views:	10243
Size:	7.4 KB
ID:	2996668   Click image for larger version

Name:	device-2014-11-02-122029.png
Views:	10561
Size:	22.8 KB
ID:	2996669   Click image for larger version

Name:	device-2014-11-02-121601.png
Views:	16800
Size:	17.7 KB
ID:	2996670   Click image for larger version

Name:	device-2014-11-02-122108.png
Views:	17809
Size:	25.9 KB
ID:	2996681   Click image for larger version

Name:	c-dev512.png
Views:	2415
Size:	89.1 KB
ID:	2996682   Click image for larger version

Name:	Screenshot_2014-11-02-12-31-39.png
Views:	2758
Size:	147.9 KB
ID:	2996683  
The Following 15 Users Say Thank You to AdamOutler For This Useful Post: [ View ]
 
 
3rd November 2014, 07:04 AM |#2  
juanflight's Avatar
Member
Thanks Meter: 12
 
Donate to Me
More
Wow!!!!
You guys are awesome... Great to see you two were able to pull this project that is otherwise much needed. Thanks Dan and Adam. =D
The Following 3 Users Say Thank You to juanflight For This Useful Post: [ View ] Gift juanflight Ad-Free
6th November 2014, 10:59 AM |#3  
iBuzman's Avatar
Senior Member
Flag Melbourne
Thanks Meter: 664
 
More
excellent. thankyou.

Sent from my D6603 using Tapatalk
The Following User Says Thank You to iBuzman For This Useful Post: [ View ] Gift iBuzman Ad-Free
7th November 2014, 07:13 PM |#4  
ngr.hd's Avatar
Senior Member
Thanks Meter: 76
 
More
Nice and thanks!

BTW any news about the new Android Wear 2 that was due to be released on Nov 3?
7th November 2014, 07:54 PM |#5  
majee12's Avatar
Senior Member
Flag Upper West Region
Thanks Meter: 91
 
More
great
If Adam wouldnt do it then who will try it . great work Adam
Quote:
Originally Posted by AdamOutler

Hi guys,

Rumor on the street has it that there is no API for making watchfaces.. Well, that's just plain wrong. I've been working with Daniel "Master of Time" Ortiz, aka @kuronosan. We've worked out a ton of the details in order to make watchface APKs easy! It's as simple as making some png resources and then putting code behind them. You just need a framework and that framework is right here! We are going to squash that "no API" rumor here and now. We've not only got the APis here, we've added nice things like transitions which you won't find on many of the other watches!





What's it all about?
This package consists of 2 major parts, the Mobile App, and the Wear App.

mobile app
The mobile app's job is to deploy the Wear app and provide an icon/view which gets installed in the app drawer, allowing the user easy access to uninstallation. After the Wear "MicroApp" App is deployed, this application serves little function. Its a little funny as the MicroApp is much larger than the primary app due to resources

Wear App
The Wear App has two entirely different activities built into it; Analog and Digital. Wear applications are basically live wallpapers. They use the Background Provider permission and they have a few additional properties such as the need to react to the DisplayManager's Screen On, Screen Dim and Screen Off commands. Aside from this, they are simply eye-candy.


Digital
The Digital section of this watch was written entirely from scratch by yours truely. I found that the animations involved in watchfaces can bloat an activity significantly. So, I use Java Inheritance to extend the classes in order to logically separate things in this way
  1. DigitalWatchfaceActivity - Handles setting up the views and intent receivers for date/time/battery and updating the time
  2. DigitalWatchfaceActions - Handles PowerManager commands and aesthetic elements such as animations/transitions.
  3. DigitalWatchfaceApp - Used to launch the activity, reserved for future use.

Analog
Watchface-Gears has provided an awesome starter for Analog Watches. Rather than reinvent the wheel, we've used their base. I had to rework a considerable chunk to add in fading transitions and refactoring for analog/digital separation. When all was said and done, between mine and Daniel Ortiz's work, the only thing that's original is Watchface-Gears library. We kept Watchface-Gears in tact because it is an awesome library. It also set the license used throughout the project. (Apache)

How do I make my own?
Here's how you get started. Being that this is mostly artwork, I can't tell you "how" to do it... But, I can do what I can do.
  1. Download the source.
  2. Load it into Android Studio
  3. Modify the package name suffix (watchface/gradle.properties: currentApplicationIdSuffix=MyCustomWatchName), and make it unique string, so when you generate a signed APK it doesn't collide with mine or others. Better yet, you should rename the entire package but that is a detailed operation.
  4. Modify both the Mobile and Wear (watchface/wear/src/main/AndroidManifest.xml & watchface/mobile/src/main/AndroidManifest.xml) files to rename the watch faces and app names for the Wear Picker.
  5. Build the package now to verify it works after you've changed properties.
  6. If you want to customize the Analog watchface app, all you need to do is modify the PNGs in watchface/wear/src/main/res.
  7. If you want to customize the Digital watchface app, you will rework both the wear/src/main/res/layout/digital_watch_layout_awake.xml and the wear/src/main/res/layout/digital_watch_layout_dim.xml. These are standard Android XML layouts.
  8. If you don't want to use the Analog or Digital, remove the AnalogWatchfaceActivity's or DigitalWatchfaceActivity's <activty> entry from watchface/wear/src/main/AndroidManifest.xml
  9. When you're done with the layouts, update the PNG files in watchface/wear/src/main/res/drawable with screenshots for the Background Provider picker (shown near the bottom).
Get creative!


CASUALWear Images
mobile app: http://forum.xda-developers.com/atta...1&d=1414986371

Digital:
CASUAL Dim


Analog
analog watch


Transitioning through Background Providers:


See attachments

Downloads and Source
You can get source here: https://github.com/adamoutler/watchface
Download it free here: https://play.google.com/store/apps/d...LWatch.release
Get the donate version and give me an excuse for my wife here: https://play.google.com/store/apps/d...ev.CASUALWatch

The Following User Says Thank You to majee12 For This Useful Post: [ View ] Gift majee12 Ad-Free
8th November 2014, 01:39 AM |#6  
iBuzman's Avatar
Senior Member
Flag Melbourne
Thanks Meter: 664
 
More
purchased (so the wife is more likely to allow future indulgences)
The Following User Says Thank You to iBuzman For This Useful Post: [ View ] Gift iBuzman Ad-Free
9th November 2014, 07:17 PM |#7  
Member
Philadelphia
Thanks Meter: 9
 
More
Does this solve the issue of notifications not being sizeable to a less intrusive size like the default faces?
10th November 2014, 08:06 PM |#8  
Junior Member
Thanks Meter: 1
 
More
Thanks Adam
The Following User Says Thank You to faboloco For This Useful Post: [ View ] Gift faboloco Ad-Free
8th December 2014, 11:11 PM |#9  
Zatta's Avatar
Inactive Recognized Developer / Recognized Contributor
Flag Sneek
Thanks Meter: 1,568
 
More
Hi Adam,

I managed to get watchface build and run on a previous version of android studio. Now that I have updated it I'm unable to build it anymore. Damn! I've changed some gradle properties according to:
http://tools.android.com/tech-docs/new-build-system
Quote:

Renamed a few properties to make things more consistent.
BuildType.runProguard -> minifyEnabled
BuildType.zipAlign -> zipAlignEnabled
BuildType.jniDebugBuild -> jniDebuggable
BuildType.renderscriptDebug -> renderscriptDebuggable
ProductFlavor.renderscriptSupportMode -> renderscriptSupportModeEnabled
ProductFlavor.renderscriptNdkMode -> renderscriptNdkModeEnabled

But I'm getting stranded on:
Code:
Error:(27, 0) Could not find property 'outputFile' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@a49d4b5.
I know I'm not the greatest dev in the world so I need some help here. Please?
30th December 2014, 06:50 PM |#10  
SchmilK's Avatar
Senior Member
Thanks Meter: 481
 
More
Awesome thank you! Now time to bang my head on the keyboard for a while and make this work!
31st December 2014, 04:30 PM |#11  
AstroDigital's Avatar
Senior Member
Thanks Meter: 120
 
More
With Android Wear 5.01 this maybe old?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes