No serial library Processing for smartphone. Help

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
  1. In the meantime, I’ll try to make a root on my phone and get into inaccessible folders.
  2. I’ll try to figure it out with the APK Editor program - it allows you to fix the manifest and files into the finished apk.

I have a small request for you, send my picture to its destination, with problems displaying lines of code on the smartphone screen, when I have a full keyboard, there is not a single line of code. I don’t know where to send it, but here no one will ever see it or correct the input area. And that’s why it’s very, very bad to work.

Many thanks to you and everyone who helped me for your help and personal time spent. You helped me a lot and provided a lot of useful information. It was a pleasure for me to have a constructive dialogue with all of you.
thank_you

no do not do it if did you wont be able to update your android software or access the playstore and you well lose many futures of your device

1 Like

your are most welcome and would like if i could help more

1 Like

explain more i did not got what you need

1 Like

Thanks for the warning.
I’ll take an old bad cheap smartphone and give it a try. Then when I solve the problem, I just need to hang it on the wall and connect it to the microcontroller for life.

take the power in your consideration

Answers

December 2016 Answer ✓

Does it work when the arduino has external power?

What is the pixel xl supplying to the arduino through OTG?

arduino uno needs minimum of 5V at 500mA

GitHub - inventit/processing-android-serial: Android Serial Library for Processing readme says not all boards are tested and the sensor they use in the example with only draws 4mA

My thoughts are to try external power for the arduino. If it works then maybe try a different flavor of arduino to limit the draw to the standard 100mA (USB C specification) for OTG.

1 Like


1 Like

go to your android setting there is option to chose the keyboard size you can make it smaller then you can see the code text area and the keyboard at the same time