# Correct way to send android camera to PC?

**URL:** <https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958>\
**Category:** Processing for Android\
**Created:** [January 10, 2021, 9:58pm UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958 "2021-01-10T21:58:25Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 10, 2021, 9:58pm UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/1 "2021-01-10T21:58:25Z")

</div>

Hello, does anyone have any example on how to send the image from the camera of an android phone to a PC with processing?

---

<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:** [January 11, 2021, 4:13am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/2 "2021-01-11T04:13:47Z")

</div>

I don’t know how “correct” it is, but it worked for me. I was able to see the android camera output on the desktop in processing.

> **[onlylemi/processing-android-capture](https://github.com/onlylemi/processing-android-capture)**
>
> AndroidCapture For Processing. Contribute to onlylemi/processing-android-capture development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 11, 2021, 5:32am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/3 "2021-01-11T05:32:48Z")

</div>

But this is an apk. I need capture and share android camera fron android processing apk. My project are a robot controlled from any windows pc with processing. The robot hardware are a android phone and arduino uno connected to phone by usb otg. I need swnd camera and receive commands to meve robot.

---

<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:** [January 11, 2021, 2:23pm UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/4 "2021-01-11T14:23:37Z")

</div>

> [@erkosone](#):
>
> how to send the image from the camera of an android phone to a PC with processing?

A picture taken and saved in the library?

> <https://github.com/EmmanuelPil/Android-java-code-utilities-widgets-for-Processing-for-Android/blob/master/Image%20Explorer>

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 13, 2021, 5:48am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/5 "2021-01-13T05:48:57Z")

</div>

Hi, thanks for the help but… really i have send a image over network from Android phone yo Windows PC.

---

<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:** [January 17, 2021, 6:05pm UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/6 "2021-01-17T18:05:35Z")

</div>

> [@erkosone](#):
>
> i have send a image over network from Android phone yo Windows PC.

What program are you planning to use on the PC to receive the file?  
And where is the file located on the phone? Or are you drawing in a sketch, and you want to send it from within?

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 20, 2021, 6:17am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/7 "2021-01-20T06:17:22Z")

</div>

Hi and good morning!  
Data it´s not a file, it´s a image captured from camera, in byte array for example pixels[].

The idea is simple, capture de camera in real time and send it to pc, same al live webcam.

---

<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:** [January 20, 2021, 6:22am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/8 "2021-01-20T06:22:26Z")

</div>

> [@erkosone](#):
>
> Data it´s not a file, it´s a image captured from camera, in byte array for example pixels.

That I understood. But you need some program to receive the ‘image file’.

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 20, 2021, 7:21am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/9 "2021-01-20T07:21:26Z")

</div>

Yes, this project is closes by two parts, one for android with camera sender and another processing program on pc to decode and draw images.

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 20, 2021, 7:22am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/10 "2021-01-20T07:22:02Z")

</div>

I think I’m going to capture the array of pixels and send it directly.

---

<div class="post-metadata">

**Author:** ![dimpapadop](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@dimpapadop](https://discourse.processing.org/u/dimpapadop)\
**Post date:** [January 26, 2021, 7:21am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/11 "2021-01-26T07:21:11Z")

</div>

so, wich is the best way to do this?  
capture the sketch canvas to an image and send over http?  
may be send a text file with the pixel array?  
If the pc sketch acts like an http server maybe?

the most efficient way i think is if the phone acts like an http server and you simply point to that address?  
the other way take a Pimage in android from an http: can be done and i have tested it.  
You just have to give cleartext permission for http in manifest xml.

```auto
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="" android:usesCleartextTraffic="true">

```

and corresponding sketch permissions INTERNET and wifi state

```auto
PImage scimg = loadImage("http://"+clientIP+":8000/screenshot.jpg");

```

so is there a way to make the processing sketch in angroid act as a simple http server and host images for example in /data folder?

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 26, 2021, 7:38am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/12 "2021-01-26T07:38:16Z")

</div>

Hello, it can be done like this, but I think it will not be necessary in my case. For me the best solution is to simply send the pixels of the image from android to PC over the network. For udp it would be ideal but for TCP it can also be useful if you are careful to wait for the acknowledgment before sending a new frame;)

---

<div class="post-metadata">

**Author:** ![dimpapadop](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@dimpapadop](https://discourse.processing.org/u/dimpapadop)\
**Post date:** [January 26, 2021, 8:13am UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/13 "2021-01-26T08:13:39Z")

</div>

> [@erkosone](#):
>
> end the pixels of the image from android to PC over th

how do you achieve that?

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [January 26, 2021, 9:28pm UTC](https://discourse.processing.org/t/correct-way-to-send-android-camera-to-pc/26958/14 "2021-01-26T21:28:08Z")

</div>

Hi, I don’t use OSC because in android it has several serious bugs when the server is the part that runs in android. For this reason I created my own network library very similar to OSC but really a standard library for processing / java.  
I have not yet written the part of the program that sends the image but it is very simple with the library that I have for processing 3, and it works perfectly on all platforms, it is based on webSockets to also be compatible with html5. As soon as I have the written program I will share it with you;)
