Doronz
Doronz

Reputation: 704

Display Watch Face in android activity

I'd like to display a watch face I've developed in my app and have it appear live as though it was on a watch. The class and engine already exist so i feel like it shouldn't be too hard to get it to appear within an activity. Does anyone have experience with this or have a suggestions as to which path to take in attempting this?

Upvotes: 0

Views: 115

Answers (1)

gruszczy
gruszczy

Reputation: 42208

It should be fairly easy to achieve. What you need to do is this:

  1. extract all the drawing logic; which is whatever code is interacting with Canvas.

  2. create a custom View and in View.onDraw(Canvas) use the extracted code to draw the watch face.

In the end everything draws on a Canvas, so you can (more or less) transfer functionality from View objects to WallpapersService. View system is an abstraction on top of Canvas.

Upvotes: 1

Related Questions