Processing for Android

EN ES

Almost all of the Processing API can be used in the Android mode. There is a number of new functions and constants that are unique to the Android mode in version 4.0+, specially relevant to wallpapers, watch faces, and VR apps.

Environment

displayDensity
orientation()
getActivity()
getContext()
getFragmentManager()
getWindow()


System events

backPressed()


Permissions

hasPermission()
requestPermission()


Multitouch

touches array
touchEnded()
touchMoved()
touchStarted()


Keyboard

closeKeyboard()
openKeyboard()


Live Wallpapers

wallpaperHomeCount()
wallpaperOffset()
wallpaperPreview()


Watch Faces

wearAmbient()
wearBurnIn()
wearInsets()
wearInteractive()
wearLowBit()
wearRound()
wearSquare()


3D

cameraUp()
eye()
getEyeMatrix()
getObjectMatrix()


Ray Casting

getRayFromScreen()
intersectsSphere()
intersectsBox()
intersectsPlane()


Virtual Reality

VR
STEREO
MONO
calculate()
VRCamera


Augmented Reality

AR
ARTracker
ARTrackable
ARAnchor


Android API

The PApplet class in the Android mode exposes some functions from the underlying Android API to make easier to receive notifications from the system:

onActivityResult()
onNewIntent()

The Fragment API for adding menu items to the App Bar is also available through PApplet:

onCreateOptionsMenu()
onOptionsItemSelected()
onCreateContextMenu()
onContextItemSelected()
setHasOptionsMenu()