Core Library Structure

codeanticode edited this page Mar 8, 2017 · 6 revisions

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

  • processing.android: Classes that wrap the Android components and services required to create a Processing app, wallpaper, or watch face: PFragment, PWallpaper, etc. They should not be used directly from the sketch.
  • processing.core: Basic Processing classes, including PApplet, PGraphics, PImage, and PFont.
  • processing.data: Data handling classes and utilities: Table, XML, JSONObject, etc.
  • processing.event: All related to event handling: Event, KeyEvent, MouseEvent, and TouchEvent.
  • processing.a2d: The classes implementing the Android2D rendererer: PGraphicsAndroid2D, PSurfaceAndroid2D, etc.
  • 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 VR (Cardboard/Daydream) 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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.