How does processing deploy an android apk

I know that the JVM (Java Virtual Machine) interprets/compiles the bytecode into platform specific code.Even processing uses Java to write sketches but how does it make an apk?
Just quite inquisitive about the inner workings.Thanks in advance.