faq how to write "observation" app or like alarm clock

I've written wf, df and time to app Slight smile

I need some quick help to not spend time on testing.

Short description, user:

-go to the app and choose form menu [start observation] (for example steps/hr etc or set alarm)

- go somewhere else (activity, wf)

- app should run in background an "observe" for some event from system or from app

question/answers

- when app is in foreground

-- is the same rules like in wf/df system call onUpdate/onPartialUpdate and burn in protection?

--is any system controls

--- like in std alarm clock app (list)

---time picker

---etc. or I should implement everything myself

- when in background

-- how to run code: should I start timer on app.onStop() to do something in background (quick tests show that app exits)

-- is it possible to show view/alarm/vibrate when event happens?

I don't have much time so If it big work I'd like to know before Slight smile

thx

  • Okay, but do you understand that there is no such thing as a "background app" like you are describing?

    You can't run a full CIQ device app at the same time as a native activity, another CIQ device app or another CIQ widget.

    As far as I know, the only kind of timer / alarm clock you can write would have to be running at the time that the alarm is scheduled, which makes it useless for your purposes.

  • You could write an alarm *data field* for CIQ 3.2 devices, since 3.2 data fields can display notifications, but that's about it, as far as I know.

  • Actually, a Background service for a CIQ app will run while recording a native activity.  They won't run if you are running a CIQ device app.  And the background for a widget will run even if the watch face has it's own background service

  • Okay, right. But I meant that the kind of fully fledged device app they are referring to won't run at the same time as other things.

    Obviously a background service won't be able to display a notification as required.

    As they noted, they don't want to write a background *service*.

    background process is not good solution it can run every 5 minutes too long.

    My app should "run" in background and has to run some code. I can put timer in view, but what happen if app is not in foreground?

  • Ok, it means that I can write widget/app which run only in time when it is in foreground.

    So system alarm clock has a special privileges and can run in background.

    I don't use  many app but for example Garmin's find car save position and when I want to back to car I have to run app and when it is visible it can write something on screen, yes?

    So, the only solution is using background process. It call app, app store data but can show view - bad solution.

    The another solution is to tell user to run app, off course in example of birthday is not good solution It can run for year... But if I want to write a special alarm I can say user, go to app set alarm and don't exit from app (but I think system close app and return to wf). Can app run in foreground for example for 10 hours?

  • Yeah, a device app can run in the foreground forever. The main concerns would be battery life and wanting to do other things with the watch haha. I imagine you could implement a power-saving mode to dim or blank the screen when after a certain timeout.

    So system alarm clock has a special privileges and can run in background.

    Yes, native system software has special privileges and can do lots of things CIQ apps can't. Think of CIQ as a sandbox which has special rules.

    I don't use  many app but for example Garmin's find car save position and when I want to back to car I have to run app and when it is visible it can write something on screen, yes?

    Yeah, exactly. Even Garmin's CIQ apps have to be running in the foreground in order to show something on the screen.

  • Ok, it means that I can write widget/app which run only in time when it is in foreground.

    Of course the issue with a widget is that it will automatically exit after a few minutes of inactivity.

  • thx,

    so no chance, no problem no app let's start to do anything else Slight smile

  • but what about app, is it kill automaticity too?