Last update 2021-05-20T00:00:00Z
this post will be constantly updated, so someone will be interested, but do not want to scroll through the posts further, they will see and know everything, show what has already been done and where we are now stuck
Conditions and purpose: to write a working program on a smartphone using APDE of any version, without touching a personal computer. Connect any smartphone or tablet via OTG cable via serial port to any microcontroller via their RX TX pins. Please do not offer to communicate via bluetooth or otherwise, and do not offer to find a computer anywhere yet. The point is to solve the problem without touching the PC via the UART.
what has been achieved:
jump to the post in the thread where the last big success happened.
5 libraries for APDE found, 2 of them are installed. Solved the issue of downloading from github if you are on a phone or tablet. Complete instructions for manually installing libraries in APDE.
library
Installing Contributed Libraries · Calsign/APDE Wiki · GitHub
manual_mode_install_library_through_dfx_for_APDE
https://youtu.be/Ua8rquFrukQ
.
GitHub - inventit/processing-android-serial: Android Serial Library for Processing
.
Release 0.2.0 · inventit/processing-android-serial · GitHub
.
GitHub - mik3y/usb-serial-for-android: Android USB host serial driver library for CDC, FTDI, Arduino and other devices.
.
Arduino ADK support as a library for the latest version of Processing (Android mode) · Issue #7197 · arduino/Arduino · GitHub
.
GitHub - geetarista/processing-arduino: Arduino library for Processing
.
the green code is never displayed in the mobile version of the browser, it is imperative to switch the display to the version for the personal computer, and this is on all browsers for smartphones and tablets.
.
current problem: Android phone system requires two extra lines in the generated output apk file in the manifest and having one xml file inside the apk. the problem is to put them there when generating the APDE of the output apk. Without them, there is no access to usb.
detals problem
.
{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>
.
<?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>
.
.http://journeytounknownsoundscapes.blogspot.com/2013/12/how-to-arduino-with-android-really-good.html
Arduino Android Serial Communication | by hingxyu | Medium
.
Impossible to grant access to USB port through AndroidManifest · Issue #84 · Calsign/APDE · GitHub
.
.
.
if you make changes to the native manifest file in APDE 5.2, then whenever I run APDE5.2, it overwrites all my changes and restores the original file state.
it turned out to place all the files in an external folder
hardware: two smartphones, one has a full system root. testing on standard arduono uno
List
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- - - - default prober - - - -->
<!-- 0x0403 / 0x60??: FTDI -->
<usb-device vendor-id="1027" product-id="24577" /> <!-- 0x6001: FT232R -->
<usb-device vendor-id="1027" product-id="24592" /> <!-- 0x6010: FT2232H -->
<usb-device vendor-id="1027" product-id="24593" /> <!-- 0x6011: FT4232H -->
<usb-device vendor-id="1027" product-id="24596" /> <!-- 0x6014: FT232H -->
<usb-device vendor-id="1027" product-id="24597" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
<!-- 0x10C4 / 0xEA??: Silabs CP210x -->
<usb-device vendor-id="4292" product-id="60000" /> <!-- 0xea60: CP2102 and other CP210x single port devices -->
<usb-device vendor-id="4292" product-id="60016" /> <!-- 0xea70: CP2105 -->
<usb-device vendor-id="4292" product-id="60017" /> <!-- 0xea71: CP2108 -->
<!-- 0x067B / 0x2303: Prolific PL2303 -->
<usb-device vendor-id="1659" product-id="8963" />
<!-- 0x1a86 / 0x?523: Qinheng CH34x -->
<usb-device vendor-id="6790" product-id="21795" /> <!-- 0x5523: CH341A -->
<usb-device vendor-id="6790" product-id="29987" /> <!-- 0x7523: CH340 -->
<!-- CDC driver -->
<usb-device vendor-id="9025" /> <!-- 0x2341 / ......: Arduino -->
<usb-device vendor-id="5824" product-id="1155" /> <!-- 0x16C0 / 0x0483: Teensyduino -->
<usb-device vendor-id="1003" product-id="8260" /> <!-- 0x03EB / 0x2044: Atmel Lufa -->
<usb-device vendor-id="7855" product-id="4" /> <!-- 0x1eaf / 0x0004: Leaflabs Maple -->
<usb-device vendor-id="3368" product-id="516" /> <!-- 0x0d28 / 0x0204: ARM mbed -->
<!-- - - - custom prober - - - -->
<!-- CDC driver -->
<usb-device vendor-id="5840" product-id="2174" /> <!-- 0x16d0 / 0x087e: Digispark -->
</resources>
.
Software: APDE any version, (latest 5.2)
.
.
I also noticed that when using the word android here, there is confusion, it has three meanings, this is confusing.
ANDROD system phone.
Processing for ANDROID (PC).
APDE processing for ANDROID.
when communicating, clarify which of these three options do you mean
.
this new branch is a continuation of a large other branch.
No serial library processing for smartphone. Help
.
here I will try to collect all the useful materials on this topic
processing-android usb serial error · Issue #11 · inventit/processing-android-serial · GitHub
https://www.allaboutcircuits.com/projects/communicate-with-your-arduino-through-android/
http://arduino.ru/forum/processing/processing-na-planshete
No serial library Processing for smartphone. Help - #37 by jafal
Using Serial with Processing for Android - #8 by noel
From java to android - #8 by svan
.
to facilitate work.
for those who want to help.
you will be working on a phone or tablet, I recommend installing Hacker’s Keyboard or its analogues. It has ready-made templates that you can fill in frequently used code fragments, as well as remember everything that got into the clipboard - you need to hold down Enter. end of line, start of line, shift + <-, shift + ->, ctrl + c, ctrl + v, ctrl + x.
This is for a tablet, but the phone does not fit a lot of useful keys on the screen, then it is probably better to use the Gboard keyboard, it has a separate mode with arrows and still has memory for the clipboard.
It may require development of xml files or some other, for this it is best to use an external text editor for programming.
Acode.
This post is not yet complete, if possible I will supplement it with information.