# oscP5 for the APDE

**URL:** https://discourse.processing.org/t/oscp5-for-the-apde/18402
**Category:** Processing for Android
**Created:** [March 5, 2020, 6:56am UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402 "2020-03-05T06:56:52Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [March 5, 2020, 6:56am UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/1 "2020-03-05T06:56:52Z")

</div>

For the APDE app to work with oscP5, it requires a full structured library with a dex.jar, So I build this new jar and you can download it [[here]](https://drive.google.com/open?id=1P8NmTRCQywYxGnuhc42LTW6HNXL8V82J). Just unzip the file into the Sketchbook/libraries folder. Below, a code for simultaneous interaction between two devices or PC. It’s pretty fast and suitable for a ping pong game. (Anyone feels challenged?)

```auto
import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress remoteLocation;
int x, y;

void setup() {
  size(400, 400);
  oscP5 = new OscP5(this, 12000); 
  remoteLocation = new NetAddress("192.168.25.4", 12000); // 192.168.25.4 has to be the IP of the other phone/PC
  fill(0);
}

void draw() {
  background(255);  
  ellipse(x, y, 10, 10);
}

void oscEvent(OscMessage m) {
  // if(m.checkAddrPattern("/tes") == true) {
  // if(m.checkTypetag("ii")) { 
  x = m.get(0).intValue(); 
  y = m.get(1).intValue();
  // }  
  //}
}

void mouseDragged() {
  oscP5.send("/tes", new Object[] {new Integer(str(mouseX)), new Integer(str(mouseY))}, remoteLocation);
}

/*
 Address patterns in the OSC protocol are used as "labels" to switch/direct easily to different functions
 using "checkAddrPattern(/yourLabel)"
 The typetag is actually a string containing the order and amount of data types that you use in 
 the Object[] parameters. For instance; "ifs" means three parameters in object respectively, int, float, and string 
 */
```

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 5, 2020, 2:07pm UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/2 "2020-03-05T14:07:32Z")

</div>

3 posts were split to a new topic: [Posts in Gallery vs platform/language mode](https://discourse.processing.org/t/posts-in-gallery-vs-platform-language-mode/18419)

---

<div class="post-metadata">

### Author: ![RoboTonzo](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@RoboTonzo](https://discourse.processing.org/u/RoboTonzo)
#### Post date: [March 6, 2020, 8:13am UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/3 "2020-03-06T08:13:59Z")

</div>

> [@noel](#):
>
> .25.4 has to be the IP of the other phone/P

Thank you.  
I will try this code and response to you

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 6, 2020, 6:16pm UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/4 "2020-03-06T18:16:44Z")

</div>

@noel – Thank you so much for making and sharing this. Any chance that you could release this through a hosted code sharing site, e.g. github? I’d love to save a copy as a community resource.

---

<div class="post-metadata">

### Author: ![HackinHarry](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@HackinHarry](https://discourse.processing.org/u/HackinHarry)
#### Post date: [June 17, 2020, 3:15am UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/5 "2020-06-17T03:15:57Z")

</div>

There’s something very cool here. I’m running processing in linux ,but ,but on a chromebook. One big problem with that is that there is no connecting serial devices to programs running in linux. I can program/upload apk’s over USB with processing(android mode) or with Android Studio though.

Will this library allow me to connect a processing sketch to an android device as if it is a serial connection?

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [June 17, 2020, 3:35am UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/6 "2020-06-17T03:35:38Z")

</div>

Hi.  
It’s not my lib, I just added the for APDE necessary dex.jar  
I mostly use bluetooth for connection between my stm-32 processors, PC and tablet.  
Depending on how much memory you have; in principle you can reprogram your Arduino boards over bluetooth or wifi. But maybe it’s easier to use ArduinoDroid with an otg cable, to directly program with your tablet/phone. I write code on my PC and use Pigeon to transfer it to my tablet’s clipboard. This way it compiles my programs in seconds using APDE. The same thing you can do with ArduinoDroid.

---

<div class="post-metadata">

### Author: ![KAZ](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kaz/32/2402_2.png) [@KAZ](https://discourse.processing.org/u/KAZ)
#### Post date: [June 17, 2020, 11:04am UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/7 "2020-06-17T11:04:25Z")

</div>

Kindly tell me What’s a Pigeon? How can I use it?

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [June 17, 2020, 11:30am UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/8 "2020-06-17T11:30:19Z")

</div>

By installing [this](https://chrome.google.com/webstore/detail/pigeon-clipboard-sync/ahknkdccndjbhgiljeafkdfpggghieag?hl=en) Chrome extension on your PC and [this](https://play.google.com/store/apps/details?id=io.quickapps.pigeon&hl=en) app on your Android phone/tablet, everything you copy will be wifi transferred to the clipboard of the other device (bi-directionally). Just select all your IDE content, copy here, paste there, and there you go.

---

<div class="post-metadata">

### Author: ![KAZ](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kaz/32/2402_2.png) [@KAZ](https://discourse.processing.org/u/KAZ)
#### Post date: [June 17, 2020, 12:42pm UTC](https://discourse.processing.org/t/oscp5-for-the-apde/18402/9 "2020-06-17T12:42:37Z")

</div>

Thank You Very Much for the Kind Information.
