Hi,
I'm building an watchface application for Android (not wear).
I need that every time the screen turns on, the activity that contains the watchface must overlap all the others.
I've tried using a service where when PhoneEvents_ScreenOn event is raised call StartActivity(Main) but don't work.
Dim jo As JavaObject = Activity
Dim Window As JavaObject = jo.RunMethodJO("getContext", Null).RunMethod("getWindow", Null)
Window.RunMethod("addFlags", Array As Object(524288)) 'FLAG_SHOW_WHEN_LOCKED
Window.RunMethod("addFlags", Array As Object(128)) 'FLAG_KEEP_SCREEN_ON
Just out of curiosity as i am waiting for my smartwatch to be delivered.
Is a watchface for android wear just a normal app or is it a special kind of app or service?
Is just a normal app. Naturally you need to set a few things for your project.
1) the watchface works only when there is no lock screen set
2) you have to create a service that is loaded when the smartwatch power on, in this service you have to check when the display turns on. In this event you have to start the activity that contain watchface.
3) all activities must be full screen and no activity title set. like:
#FullScreen: True
#IncludeTitle: False