Android processing and Puredata communication

Hi there,

I have problem about communication between Android processing and Pure data. When I run my code in processing, I see on the back of my screen that the phone send information to my computer but definitly not to pure data. That surprise me because the code is working in java but not in android.
I’ve already check the permission for android in my computer, the both are connect on the same wifi and I use to communicate with PD oscp5 for processing and mrpeach to receive in PD

Here the code :
import oscP5.;
import netP5.

import controlP5.*;
ControlP5 controlP5;
Knob myDial;
Slider mySlider;

OscP5 oscP5;
NetAddress myRemoteLocation;

int knobValue = 100;

void setup() {
// create a new instance of oscP5.
// 12000 is the port number you are listening for incoming osc messages.
oscP5 = new OscP5(this, 12000);
myRemoteLocation = new NetAddress(“”, 12000);
controlP5 = new ControlP5(this);
myDial = controlP5.addKnob(“knobValue”)
.setPosition(100, 100)
.setSize(200, 200);

void draw() {
fill(255, 0, 0);
void mousePressed() {
/* in the following different ways of creating osc messages are shown by example /
//OscMessage myMessage = new OscMessage(int(knobValue));
OscMessage myMessage = new OscMessage("/test");
send the message */
oscP5.send(myMessage, myRemoteLocation);

the routing in pd :

[import mr peach] -----> [udpreceive 12000]--------->[unpackOSC]------->[routeOSC /test]---->[number]

if someone can help me that would be great,
Thanks in advance

Can you explain a little more detailed.
Are you using the posted code on android or PC?
If using PD on android are you using this lib?

I found also this link.

Also you could try to send TCP or UDP messages instead of OSC…


The processing code is on a phone and he need to communicate with the pd patch on a computer but I found the solution, it was a problem of IP adress.
Now, I’ve just a problem with the accelerometer who does’nt want send antything. But I’m sure (and I hope) that it’s gonna work soon.

1 Like

Thus you are managing to community OSC with PD successfully. (not TCP or UDP) ?

I’m not sure to understand your last question,
I’m sending with oscp5 and I’m still using a UDPreceive in PD, but I was using a wrong IP configuration in my processing code.
And in PD you only need to give the port. Doesn’t need IP adress only where it need to listen.

1 Like