# oscP5 library, sending data with network

**URL:** <https://discourse.processing.org/t/oscp5-library-sending-data-with-network/3244>\
**Category:** Processing for Android\
**Created:** [September 4, 2018, 9:45am UTC](https://discourse.processing.org/t/oscp5-library-sending-data-with-network/3244 "2018-09-04T09:45:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [September 5, 2018, 2:31am UTC](https://discourse.processing.org/t/oscp5-library-sending-data-with-network/3244/3 "2018-09-05T02:31:50Z")

</div>

Can you describe your setup please and the data flow that you envision happening between your different devices?

If you are getting your data from a server, via an url, then you can use [loadStrings()](https://processing.org/reference/loadStrings_.html). If you are working with computers in a local network and one computer is always feeding the data, then you can set that computer as a server by setting a [local server](https://github.com/processing/p5.js/wiki/Local-server) and then stick to `loadStrings()` (Untested). Now, if this is done between android devices, this approach might not work. Instead, I will stick to oscP5 or websockets.

Some other topics I found online:

> [https://forum.processing.org/two/discussion/9090/processing-and-android-how-to-transfer-pictures](https://forum.processing.org/two/discussion/9090/processing-and-android-how-to-transfer-pictures)

> [Android-\>PC UDP communication - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/8860/android-pc-udp-communication)

If you use oscP5, notice there is a limit on the size of data on a transaction. Hence, you will need to break your file into pieces and send them one by one and stitch them together at the other end. The oscP5 also has an option to establish a TCP connection, which it would be more reliable than using the default UDP protocol. Notice I have not tested the oscP5 TCP version in android, so take my comment with a grain of salt. From what I read, suing a TCP is more convenient as the TCP should be able to handle the breaking up of the packages into the right size for you. Again, this is untested and hopefully somebody in the community can share their experiences here.

Found some other relevant posts:

> [Server & Client](https://discourse.processing.org/t/server-client/1007)

> [Server-\>client reply](https://discourse.processing.org/t/server-client-reply/1877)

They are not a final solution unfortunately. Hopefully all these post will help with putting together a simple example.

Kf

---

_[View the full topic](https://discourse.processing.org/t/oscp5-library-sending-data-with-network/3244)._
