# netP5 (TCP/IP networking under android)

**URL:** <https://discourse.processing.org/t/netp5-tcp-ip-networking-under-android/3046>\
**Category:** Coding Questions\
**Created:** [August 27, 2018, 11:50pm UTC](https://discourse.processing.org/t/netp5-tcp-ip-networking-under-android/3046 "2018-08-27T23:50:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtmr](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dtmr](https://discourse.processing.org/u/dtmr)\
**Post date:** [August 27, 2018, 11:50pm UTC](https://discourse.processing.org/t/netp5-tcp-ip-networking-under-android/3046/1 "2018-08-27T23:50:00Z")

</div>

netP5 problem: The code below only works with the delay, otherwise the Client.send() operation throws a null pointer exception. Should I check/wait for something after creating a client?

```auto
Client = new TcpClient(Listener, IP, 23, TcpServer.MODE_NEWLINE);
    
delay(1000);
    
Client.send("MC@\r");

```

No exception with MODE\_STREAM - but with MODE\_STREAM, the listener (implemented a per example from Andreas in this topic: [https://forum.processing.org/one/topic/networking-between-android-and-server-connectbot-type-of-thing#25080000001863165.html](https://forum.processing.org/one/topic/networking-between-android-and-server-connectbot-type-of-thing#25080000001863165.html)) receives no data from the addressed mircocontroller, which sends \r\n-terminated strings. I donät really know what streams are.
