APDE USB / OTG communication

versions of what?

the Procedure is old

let me make simple project if it worked i am going to try APDE i need 1 or 2 days


That would be great.

A working solution, with a bit of work from you, is already in your post:

This was my starting point and I have shared this link with you before:
Impossible to grant access to USB port through AndroidManifest · Issue #84 · Calsign/APDE · GitHub

Calsign states:

Yes technically you can achieve what you want by modifying the manifest template, but this isn’t really a solution for most users because it means that every sketch built with the modified version of APDE will have the uses-feature tag.

@glv steps to modify the manifest template:

  1. Download the APDE.apk (APDE v0.5.1 Alpha) from:
    GitHub - Calsign/APDE: Source code for APDE: Create and run Processing sketches on an Android device.

  2. Use an APK Editor of your choice (I used APK Easy Tools on my PC) and modify this file:

To this:

Modified AppManifest.xml.tmpl
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    <!-- Added -->
    <uses-feature android:name="android.hardware.usb.host"/>
    <uses-sdk android:minSdkVersion="@@min_sdk@@" android:targetSdkVersion="@@target_sdk@@" />
    <application android:label=""
        <activity android:name=".MainActivity"
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            <!-- Added -->
                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
            <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" 
  1. Install the modified APDE.APK on the Android phone.

  2. Add this directory and file /res/xml/device_filter.xml to the sketch folder.
    This device_filter.xml (there are others) worked for me:
    processing-android-serial/src/main/examples/PulseSensor11574/res/xml/device_filter.xml at master · inventit/processing-android-serial · GitHub

  3. APDE Preview mode did not work (some more modifications would be necessary) however I created an App and this worked.

This works for my needs.

I have tested it and able to reproduce the results. :)

I wrote a very simple sketch on the Arduino to count and send to serial port and received this with my app (used the modified APDE to make this) on the Android phone.

I now have serial communication between my Android Phone (Version 9) and Arduino Mega 2560 R3 (using an OTG cable) with an app created with the modified APDE.

I have not worked with the APDE or an APK editor before so this was a worthwhile adventure and I now have some new tools, experience and skills for my technical resume.

Be methodical, meticulous and document while working on this.

The rest is up to you. Enjoy the journey!

UPDATE 2021-05-21
I used the AndroidSerial for Processing library latest release 0.2.0 available here:



i have said the you are able to solve it … on android mode the steps much easier and more simple

1 Like

@ZENAR57 the Procedure of @glv is slimier for what i did in android mode it should work with you simply after you modify APDE make this folders inside your sketch folder /res/xml/ then add
device_filter.xml file

1 Like

That woul bi great.
As soon as I have a free minute, I’ll do it right away.

This seems to be the simplest solution. now the main thing is that it would work out normally. I’ll try at home for the night.


5.1alpha on my phone doesn’t want to download any zip library, even before modification. can it be done with 5.2 betta. Why only 5.1alpha?


I designed a temperature measurement program on the Arduino and it works on the Android over OTG

i finish Android mode now next step APDE mode




And what is your Arduino sensor that measures temperatures up to 400 ° C?

1 Like

Some versions of APDE do not load compressed zip libraries, and some do well on the same smartphone.

they got a new library 4 days ago. only it is not compressed, there is no zip file.

Hello @ZENAR57,

My exploration of this ended with this topic:
APDE USB / OTG communication - #24 by glv

I am not using APDE and Android phone as my development environment at this time.

If I am so inclined I will add to the topic.

Enjoy the exploration and the journey!

I hope you reach your destination.



Thank you so much for your input!


Thank you.
you have done a lot.
your contribution was very great. Always welcome to this topic.

1 Like


Source code(zip)

Source code(tar.gz)

1 Like

Is there a jar version of this?

1 Like

here it is as a jar, also the eclipse files should you wish to amend the build.