Core Library Structure

codeanticode edited this page Jun 14, 2016 · 4 revisions

The Android core library follows very closely the structure of the Java core library. It is organized in four main packages:

  • processing.core: Basic Processing classes, including PApplet, PGraphics, PImage, and PFont.
  • Data handling classes and utilities: Table, XML, JSONObject, etc.
  • processing.event: All related to event handling: Event, KeyEvent, MouseEvent, and others.
  • processing.opengl: The classes implementing the OpenGL renderer: PGraphicsOpenGL, PGraphics2D, PGraphics3D, PShader, PGL.

Differences between versions 3 and 4 of the mode

The version 4.0 of the mode introduces significant changes in the structure of the core library in order to support wallpapers, watch faces, and Cardboard apps. PApplet simply extends Object, and contains a surface instance of type PSurface. PSurface holds the activity associated with the PApplet (in the case of regular sketches), or the service (for wallpapers and watch faces), the corresponding surface view, and the rendering thread.