No serial library Processing for smartphone. Help

1 Like

thank_you

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


All? All All?
3d5bf1461f0814e1bbf352b1355de1f0

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

then click on

AndroidManifest takes you here

1 Like

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_124835

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.

android usb serial lib crashing app

precociousmouseprecociousmouse

December 2016 edited December 2016 in Android Mode

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:

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?

1 Like



1 Like

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


you misunderstand me my last photos is just to show you how to locate AndroidManifest.xml and open it

1 Like

the AndroidManifest.xml in my photo refers to my own sketch each sketch got its own AndroidManifest.xml file

1 Like

modify this 2 files

with this 2 files

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:

as this link instructions

1 Like

I can find absolutely any file on any device, if I have access to it and I do not need root rights.
A global search of the entire disk returned no results.

I created these two files manually, they weren’t there! but when building the APK it didn’t give any results. I then extracted apk, broke it and looked at the manifest.

post your code if you please

1 Like

I took the codes from the examples on your links. there are no questions to the code, but I tortured them, there was nothing left of them, since I tried to connect different libraries. The point is adding and editing the manifest file and adding the device_filter.xml file

** Serial.list(this)** <–crash

I don’t even configure the port anymore!
just polling the list of devices.

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.*;


import org.firmata.*;
import cc.arduino.*;


String received; // данные, получаемые с последовательного порта 

//=============================

Serial port;
float val = 0;
int temp=1;
void setup() {
size(600,600);
if (Serial.list(this)[0] ==null){temp=0;}
//port = new Serial(this,Serial.list(this)[0],57600);
//port.bufferUntil('\n');
background(0,val,0);
}
void draw() {


//void serialEvent(Serial port) {
//val = float (port.readStringUntil ('\n'));

//if ( port.available() > 0) { // если есть данные, 
//received = port.readStringUntil('\n'); // считываем данные } println(received); //отображаем данные
fill(255, 50,50);
text(temp, 100,100);
//}
//ellipse(10,10,20,20);
}


//Serial serial;
/*
void setup(){
  
  Serial myPort; // List all the available serial ports: 
  printArray(Serial.list()); // Open the port you are using at the rate you want: 
  myPort = new Serial(this, Serial.list()[0], 9600); // Send a capital A out the serial port: 
  myPort.write(65); 

  
  fullScreen();
  fill(125);
  ellipse(100,100,200,200);
}//setup
void draw(){
  
}//draw

*/

so you cross the half way now i think its good for you now to open new topic how to edit and add AndroidManifest.xml

i think there is many guys here could help with that

most what i post is searching from the net no thing is official and take in consideration all posts deals with older version of APDE
and not update to newer APDE which means that it might works or not

you need help from person has deal with this issue and solve it or searching the net may you find something

1 Like

i am going to give it a try if i get something i well inform you

1 Like