Skip to content

Lifecycle of a Processing sketch

codeanticode edited this page Dec 22, 2017 · 13 revisions

This page is intended to give an overview of how a Processing for Android sketch is initialized and run by the Android system, and to help understanding what classes from the core library are involved in handling the low-level rendering and input operations through the Android API. This lifecyle is different depending if the sketch is run as a regular app, a live wallpaper, a watch face, or a VR app. Let's start looking into the details for a regular app:

Running a sketch as a regular app

Every time you run a sketch from from the Android mode as a regular app, for example something as simple as the following code:

void setup() {
  fullScreen(P2D);
}
void draw() {
  if (mousePressed) {
    ellipse(mouseX, mouseY, 50, 50);
  }
}
Clone this wiki locally