Android Programming for Beginners

*** UPDATE 1 ***

When you install software on a system with a lot of baggage it may impact your current install.

This is important to know even for beginners!
I will impact you at some point.

Baggage in this case is from previous installs:

  • environment variables
  • multiple versions of Java
  • multiple versions of Processing
  • .gradle folder
  • preferences.txt
  • registry
  • Anything I missed!

Working Windows 10 development environment for my personal use:

  • Windows 10 Pro Version 22H2
  • Processing 4.4.4 (portable version) I do not use MSI install.
  • Motorola Android Phone (Android version 14)
  • Android Mode for Processing 4.6.1 (Installed July 28).
  • I did an SDK update from the Processing menu.
  • OpenJDK with PATH set in environment variables

With OpenJDK installed:

C:\Users\GLV>java -version
openjdk version “17.0.15” 2025-04-15
OpenJDK Runtime Environment Temurin-17.0.15+6 (build 17.0.15+6)
OpenJDK 64-Bit Server VM Temurin-17.0.15+6 (build 17.0.15+6, mixed mode, sharing)

When I removed the PATH in the environment variables it failed!

I tried to be rigorous testing this and will revisit another day.
This is currently working but still subject to further testing.

Windows 11 I am leaving for future exploration.
I want to see if an OpenJDK install works there.
May test other PATH settings to Processing as well.
Another day!

*** UPDATE 2 ***

Same day!

These were in some of the errors I saw in console when there were fails:

Caused by: net.rubygrapefruit.platform.NativeException: Could not start ‘C:\WINDOWS\system32\java.exe’

Caused by: java.io.IOException: Cannot run program “C:\WINDOWS\system32\java.exe” (in directory “C:\Users\GLV.gradle\daemon\7.2”):

This seemed to work (corrects above?) in environment user variables as well (replaced OpenJDK PATH) and points directly to folder with java.exe:

image

*** UPDATE 3 ***

I just had to test this!

Working Windows 11 development environment for my personal use:

  • Windows 11 Pro
  • Processing 4.4.4 (portable version) I do not use MSI install.
  • Motorola Android Phone (Android version 14)
  • Android Mode for Processing 4.6.1 (Installed July 28).
  • I did an SDK update from the Processing menu.
  • No other Java versions
  • This is a recent fresh install of Windows 11 so little baggage except Microsoft bloat.
  • Path in Environment Variables set to:

C:\Programs_Portable\Processing\app\resources\jdk\bin

This will be different for your system!

I am cautiously optimistic that this may be solution for getting Android Mode for Processing (4.6.1) to work with Processing (4.4.4) on W10 and W11.

This will require additional testing + validation + process checks.

@stefterv @sableraph
What do you think?
Initial testing seems to indicate that this may work.

*** UPDATE 4 ***

I removed any environment variables I set for testing.

Launching it from a batch file works for me for W10 and W11.
Paths MUST be correct for your system setup.

@svan Want to give it a try?

I can run the batch file to launch Processing 4.4.4 with Android Mode 4.6.1 and do not have to hardcode it into Windows environment variables.

Launch.bat:

@echo off
set JAVA_HOME=D:\Program_Portable\Processing-4.4.4\app\resources\jdk
set ANDROID_SDK=D:\Users\GLV\Documents\Processing-4.4.4\android\sdk

set PATH=%JAVA_HOME%\bin;%ANDROID_SDK%\platform-tools;%ANDROID_SDK%\cmdline-tools\latest

start D:\Program_Portable\Processing-4.4.4\processing.exe

Additional Issues

The default Android paths in preferences.txt are not correct and I can’t change them.
The batch file sets them for temporary use and that seems to work.

Launching Android Mode updates the preferences.txt to this regardless of what I have edited:

ANDROID_SDK=D:\Users\GLV\Documents\Processing\android\sdk
JAVA_HOME=D:\Program_Portable\Processing-4.4.4\runtime
PATH=D:\Program_Portable\Processing-4.4.4\runtime\bin;D:\Users\GLV\Documents\Processing\android\sdk\platform-tools;D:\Users\GLV\Documents\Processing\android\sdk\cmdline-tools\latest;null

Each time I launch Android Mode it adds to the path:

ANDROID_SDK=D:\Users\GLV\Documents\Processing\android\sdk
JAVA_HOME=D:\Program_Portable\Processing-4.4.4\runtime
PATH=D:\Program_Portable\Processing-4.4.4\runtime\bin;D:\Users\GLV\Documents\Processing\android\sdk\platform-tools;D:\Users\GLV\Documents\Processing\android\sdk\cmdline-tools\latest;D:\Program_Portable\Processing-4.4.4\runtime\bin;D:\Users\GLV\Documents\Processing\android\sdk\platform-tools;D:\Users\GLV\Documents\Processing\android\sdk\cmdline-tools\latest;D:\Program_Portable\Processing-4.4.4\runtime\bin;D:\Users\GLV\Documents\Processing\android\sdk\platform-tools;D:\Users\GLV\Documents\Processing\android\sdk\cmdline-tools\latest;null

:)