processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

Add service() function

Open codeanticode opened this issue 7 years ago • 0 comments
trafficstars

Being able to create foreground services is an useful feature. Right now, one needs to add java code to the sketch, which is hard to read and to integrate with the sketch:

https://discourse.processing.org/t/notification-builder/1101

It would be nice to be able to do something like this:

void setup() {
  
  service("task", 2000); // call function task() below every 2 seconds.
}

void draw() {
  ...
}

void task() {
  // code to execute as a foreground service
}

Although this would involve adding new templates into the mode so the service class is generated behind the scenes.

codeanticode avatar Jun 25 '18 12:06 codeanticode