Processing for Android

orientation()

Call this function in setup() to fix the orientation of the phone to landscape or portrait and avoid auto-rotate (which restarts the app):


void setup() {
  orientation(LANDSCAPE);    
}                    
                

void setup() {
  orientation(PORTRAIT);    
}