# No serial library Processing for smartphone. Help

**URL:** https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870
**Category:** Processing for Android
**Created:** [May 5, 2021, 9:34am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870 "2021-05-05T09:34:04Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 3:34am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/21 "2021-05-07T03:34:26Z")

</div>

> **[How to Arduino with Android really good!](http://journeytounknownsoundscapes.blogspot.com/2013/12/how-to-arduino-with-android-really-good.html)**
>
> It's time to open a new chapter in my "How To Arduino" book. Two weeks ago I bought an Android tablet. Now it's time not to play games on t...

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 3:37am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/22 "2021-05-07T03:37:29Z")

</div>

[https://forum.processing.org/two/discussion/17375/android-processing-app-crashes-when-using-usb-processing-serial-library-serial-list-this-probs](https://forum.processing.org/two/discussion/17375/android-processing-app-crashes-when-using-usb-processing-serial-library-serial-list-this-probs)

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 4:07am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/23 "2021-05-07T04:07:52Z")

</div>

[http://arduino.ru/forum/processing/processing-na-planshete](http://arduino.ru/forum/processing/processing-na-planshete)

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 7, 2021, 8:27am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/24 "2021-05-07T08:27:14Z")

</div>

Thank you so much. I will teach and understand everywhere.  
 ![thank_you](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/34fe6dfbb5b9ca18529c11cea0b49f72cb1f17d5.gif)

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 7, 2021, 10:23am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/25 "2021-05-07T10:23:38Z")

</div>

fails to initialize.

everything works at the terminal, the data goes. **cable is connected!**  
at the same time, on the APDE problem

port = new Serial(this,Serial.list(this)[0],57600);// causes crash start if icommented out this string, it is not destroyed at startup

copilation-OK  
 ![scratch_one-s_head](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1b7a411ac6b8649c918e1a9134d3a46fcec7721f.gif)

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 7, 2021, 3:04pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/26 "2021-05-07T15:04:34Z")

</div>

![Polish_20210507_180213919](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/ad5b64f7fa427c70a91bf4739a9065eb693d83bc.jpeg)

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 7:20pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/27 "2021-05-07T19:20:31Z")

</div>

@ZENAR57

hi try to enable all permissions

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 7:27pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/28 "2021-05-07T19:27:16Z")

</div>

have you made this ???

```auto
First we have to change the AndroidManifest.xml in the project root:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package=""
          android:versionCode="1"
          android:versionName="1.0">
  <uses-sdk android:minSdkVersion="10" />
  <application android:label=""
               android:icon="@drawable/icon"
               android:debuggable="true">
    <activity android:name="">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
      </intent-filter>
      <meta-data
          android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
          android:resource="@xml/device_filter" />
    </activity>
  </application>
</manifest>

The blue marked lines must be added to your AndroidManifest.xml. This is not well documented in the pages of the processing lib, this info can be found on the pages of the "usb-serial-for-android" project.
And we have to add a file to

{processing project root}\res\xml

Filename: device_filter.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- 0x0403 / 0x6001: FTDI FT232R UART -->
    <usb-device vendor-id="1027" product-id="24577" />

    <!-- 0x2341 / Arduino -->
    <usb-device vendor-id="9025" />

    <!-- 0x16C0 / 0x0483: Teensyduino -->
    <usb-device vendor-id="5824" product-id="1155" />

    <!-- 0x10C4 / 0xEA60: CP210x UART Bridge -->
    <usb-device vender-id="4292" product-id="60000" />
   
</resources>

This file informs the application which serial adapters can start the application. The file and more info you can find here:

```

which is in this link ?

> **[How to Arduino with Android really good!](http://journeytounknownsoundscapes.blogspot.com/2013/12/how-to-arduino-with-android-really-good.html)**
>
> It's time to open a new chapter in my "How To Arduino" book. Two weeks ago I bought an Android tablet. Now it's time not to play games on t...

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 7, 2021, 7:43pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/29 "2021-05-07T19:43:46Z")

</div>

not. I’m not that advanced.  
I didn’t think of a manifesto.  
I’ll try later, your code at night.  
 ![thank_you](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/34fe6dfbb5b9ca18529c11cea0b49f72cb1f17d5.gif)

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 7:48pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/30 "2021-05-07T19:48:41Z")

</div>

> <https://github.com/inventit/processing-android-serial/issues/16>
>
> Hi, I'm using an open source app called APDE to run processing on my android and… I'm using this serial library to communicate between an arduino and the phone. I've really struggled to get this all working as I'm pretty new to it, so maybe I'm doing something obviously wrong. Here's some simplified code that is still making the app crash:
> 
> import io.inventit.processing.android.serial.\*;
> import org.slf4j.\*;
> import org.slf4j.helpers.\*;
> import com.hoho.android.usbserial.util.\*;
> import org.slf4j.spi.\*;
> import com.hoho.android.usbserial.driver.\*;
> import com.hoho.android.usbserial.\*;
> import org.slf4j.impl.\*;
> 
> // add the serial library
> Serial myPort; // the serial port to monitor
> void setup() {
> size(1000, 1750); // set the window size, size() also sets width and height variables
> myPort = new Serial(this, Serial.list(this)\[0\], 9600); // define input port
> myPort.clear(); // clear the port of any initial junk
> }
> 
> void draw () {
>    
> }
> 
> I think the crash occurs at "myPort = new Serial(this, Serial.list(this)\[0\], 9600);" Does anyone have any advice? I'm using android version 8.0.0 and I believe I imported the libraries correctly into APDE. I also know I probably don't need a ll of those import, but I'm not competent enough to delete the unnecessary ones. If you need any more info, let me know!

Hi, you have to make quite some adjustments. Follow these instruction:

> **[Communicate with Your Arduino Through Android - Projects](https://www.allaboutcircuits.com/projects/communicate-with-your-arduino-through-android/)**
>
> Want to send text to an Arduino with an Android smartphone? Here's how! This article will show how an Arduino (or almost any other microcontroller) can

You’re AndroidManifest.xml must be correct and you need a device\_filter.xml (with the correct Arduino). There’s lot of information available, just search for it.

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 7:53pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/31 "2021-05-07T19:53:29Z")

</div>

> <https://github.com/inventit/processing-android-serial/issues/11>
>
> Hey there! I am trying to use the library in an app that passes the content of t…ext messages through to an arduino. The device I am using for this is a Pixel XL running 7.1.1
> 
> My problem is that I receive the following error popup when I connect the device to the arduino:
> 
> Port: null
> Check the following items:
> 1. Make sure AndroidManifest.xml contains use-feature tag for android.hardware.usb.host
> 2. USB serial is connected to the device
> 
> I do have the use-feature tag in the xml, and the device is connected but I can't get the app beyond that error.
> 
> Any thoughts why this could be the case?

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 7, 2021, 8:17pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/32 "2021-05-07T20:17:16Z")

</div>

> [@From java to android](https://discourse.processing.org/t/from-java-to-android/25022/8):
>
> @JoseMY. I just purchased an OTG (On The Go) cable and am interested in getting it to work on my Nexus 4 running Android 4.4. Any help would be deeply appreciated. I would like to send/receive text or data with an Arduino Uno if that is possible. I know the cable was initially designed primarily to run a printer and could probably find one to hook up if necessary. We might have to start a new thread if you’re interested in pursuing this.

> [@Anyone possible make project](https://discourse.processing.org/t/anyone-possible-make-project/25109):
>
> Hello to All this my project ; this working fine on java mode from serial (run on window 10) i need run same project on android app phone via bluetooth and from usb connect output encoder. i test on windows it work who help me. this is code:import processing.serial.\*; Serial myPort; String myString = null; int incoming\_position = 0; float position\_in\_degree = 0; PFont font18,font63; void setup(){ size(800, 600); font18 = loadFont(“Tahoma-18.vlw”); font63 = loadFont(“Tahoma-63.vlw…

> [@Using Serial with Processing for Android](https://discourse.processing.org/t/using-serial-with-processing-for-android/22974/8):
>
> Have you closed all other programs that could be using your serial port, for example arduino serial monitor, hyperterminal, etc. ?

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 7, 2021, 10:15pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/33 "2021-05-07T22:15:40Z")

</div>

![thank_you](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/34fe6dfbb5b9ca18529c11cea0b49f72cb1f17d5.gif)

 ![SmailikSbor8](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/eb1bf571d98f3c633691df20625dc0f1a417982e.jpeg)

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 8, 2021, 12:29am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/34 "2021-05-08T00:29:27Z")

</div>

> [@jafal](#):
>
> You’re AndroidManifest.xml must be correct and you need a device\_filter.xml

I read everything, everything is clear, except for one.  
I can’t find the files themselves, I’ve searched everything. Do you need Ruth on your phone? if yes, then I do not have a root.  
 ![af5ade365c136188a3da5a13baf396a5](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/9be67188984080ff66da9c7bb9c5624546ce12b9.jpeg)

> [@jafal](#):
>
> hi try to enable all permissions

 ![Screenshot_20210508_031016_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/40c4696d721e144434fb9818a206aa01b9f436f1.jpeg)  
All? All All?  
 ![3d5bf1461f0814e1bbf352b1355de1f0](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a1868068690f809a6de1442931d7cd3ee647f189.png)

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 8, 2021, 2:57am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/35 "2021-05-08T02:57:42Z")

</div>

on windows processing android mode just press `ctrl+k` this take you to this folder

 ![Untitled 165](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/ec2c0349ae965abf913da1619eb52ab3d015dfd2.jpeg)

then click on

AndroidManifest takes you here

 ![Untitled 164](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/ae3207348c7ccf56298177168a8549c9c1f63b37.jpeg)

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 8, 2021, 9:42am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/36 "2021-05-08T09:42:21Z")

</div>

**I haven’t had a computer in years!**

maybe I was wrong again and wrote in the wrong forum thread? I came here from the library theme to make it clear and unambiguous.

 ![Screenshot_20210508_123543](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a2bec9ab054786e49c9bab0e7fe5f7b6baf9db40.jpeg)

 ![Polish_20210507_163639638](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4585e99feeca74869b5b7c309d8cd44f2ace89e1.jpeg)

![Screenshot_20210508_124835](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d9aff50719882229c1e1ffab5fa16f3047fb156e.jpeg)

 ![Polish_20210508_164633283](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/ec8eda79e82d546e149929366a9096013f8abf02.jpeg)

 ![IMG_20210508_120828](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/ca5414f8052fbd7e551c631cf3cb8b57f6b45eef.jpeg)

> [@jafal](#):
>
> which is in this link ?

I read everything, everything is clear what needs to be done. But since I did not find a simple manifest file in the project folder, I decided to postpone what is written there until the very last moment, since it seems to me it will be very difficult.

 ![Screenshot_20210508_144705](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f8a17f539c0f71e9437b305ac3f18d8f6bb58393.jpeg)

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 8, 2021, 1:55pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/37 "2021-05-08T13:55:28Z")

</div>

# android usb serial lib crashing app

[![precociousmouse](https://secure.gravatar.com/avatar.php?gravatar_id=f3fbd199f953e4c4109d3682ee84a2a6&size=50&default=https%3A%2F%2Fvanillicon.com%2Ff3fbd199f953e4c4109d3682ee84a2a6.png)](https://forum.processing.org/two/profile/30322/precociousmouse)[precociousmouse](https://forum.processing.org/two/profile/30322/precociousmouse)

[December 2016](https://forum.processing.org/two/discussion/19687/android-usb-serial-lib-crashing-app) edited December 2016 in [Android Mode](https://forum.processing.org/two/categories/android)

Hi all! Another day, another question - I am building an app that takes the content of sms and pushes it through to an arduino using the android usb serial lib here:

> **[GitHub - inventit/processing-android-serial: Android Serial Library for Processing](https://github.com/inventit/processing-android-serial)**
>
> Android Serial Library for Processing

I am running the app on a pixel xl running nougat 7.1.1, and using the usb otg adapter to connect to an arduino uno. I have modified the manifest xml, and added in the device filter xml (ensuring that it includes the uno device id) but when I run the app it throws this error:

"Processing-Android USB Serial ERROR

Port: null Check the following items: 1. Make sure AndroidManifest.xml contains use-feature tag for android.hardware.usb.host 2. USB Serial is connected to the device"

I have checked that the manifest has the use-feature tag, and the usb cable is plugged in and supplying power to the arduino, but if I plug the cable in before starting the app, or plugging it in after the app has started, or even plugging it in before, then unplugging it when the error shows and replugging - it always throws the same error and closes when I close the dialogue.

I was wondering whether the android manifest requirements have changed since the release of nougat but that doesn’t seem to be the case. Does anyone have any ideas why this could be causing a problem?

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 8, 2021, 2:01pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/38 "2021-05-08T14:01:26Z")

</div>

![Screenshot_2021-05-08-16-49-27-687](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/95e549f89689f7bce4fa7b610b75cd02e8f97148.jpeg)  
 ![Screenshot_2021-05-08-16-36-47-838](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/fa863b6336d8624d19b55947c7ce27723aa5a57b.jpeg)  
 ![Screenshot_2021-05-08-16-51-31-249](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c93f9a7d3779ad18a3c20c268251f3147ce285b2.jpeg)

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 8, 2021, 2:13pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/39 "2021-05-08T14:13:52Z")

</div>

Okay, just try to add. to this folder. both files.

---

<div class="post-metadata">

### Author: ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)
#### Post date: [May 8, 2021, 3:53pm UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/40 "2021-05-08T15:53:44Z")

</div>

![Polish_20210508_185024031](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/412e4925e8a7330b19235883da6b778f458937cb.jpeg)  
 ![symbols_over_mouth_animated_sticker](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c7018c02280c36a2d44a0cd11f658e58633aebd9.gif)

[Previous page](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870.md?page=1)

[Next page](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870.md?page=3)
