What is Processing?
Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Processing sketches run on the Java Virtual Machine and it’s written using Java syntax. It can also be written in Python (but it still runs on the JVM). Since it runs on the Java Virtual Machine it is able to run on Android devices as well.
Processing has it’s own code editor which makes developing Processing code very easy. You can find the editor here. The official PRocessing code editor is not the only thing that you can use. Aside from the official editor, a lot of people use Eclipse (for desktop applications) and Android Studio (for Android apps). You can develop Android apps directly from the Processing program, but it doesn’t give you nearly as much options as Android Studio does.
You can find the official documentation on how to install Processing for Android here, but this is for installing the Processing extension. Now, I’m gonna show you how to use Processing with Android Studio.
Create a Android Studio project like you would usually.
Next, copy android-core.jar to /app/libs, and add it as file dependency to the project:
Now you will create a class that extends the PApllet class. That would look something like this:
And you need to initialise this in the Activity that’s going to be using Processing, like this:
This code has been pulled from android.processing.org, and I recomend you check this website out.
My opinion on using Processing in your Android app
I’ve known of Processing for about a year now. I used it a couple of times for some small desktop apps that I built while I was bored. And I evan built an extremely simple Android app using only Processing, but I’ve never incorporated it in a real app. I am planing to use it on my next project that I’m gonna be starting out next week . I will use it on a small part of my app. I chose Processing because it uses Java syntax, and there is really not mutc to it. It’s really simple to learn if you already know Java, and it’s really really fun to mess around with.