Development of processing for android

Hello everyone
I created pull request in processing for android a month back, It’s already approved. Any mentor please review or merge it.


Meanwhile code below is working on my Samsung S4 Lollipop (Although depricated )
I’ll try to write a code for newer camara mode

import android.hardware.Camera;
import android.hardware.Camera.Parameters;

public static Camera cam = null;
boolean on;

void setup () {
  cam =;

void draw () {

void mousePressed () {
  Parameters p = cam.getParameters();
  if (p.getFlashMode() != null) {
    if (on) {
    } else {
  on = ! on;

void onStop () {
  cam = null;

I remembered that the Ketai lib also handles flashlight. You can find the code here
You can find the related code beginning at line 390. It does however also use the “Camara api”, not the newer camara2.
If you have a device using android above lollipop, please comment if you have any problems.

Thanks @noel that works great… I just thought that there should be a built in method in PApplet since opening flashlight is a basic android function.

Please tell me the name of android version and device that you used.

@noel sorry for the late reply… its Oreo 8.1, oppo A3s

1 Like