UPDD for Android (UPDD 6)

This document describes UPDD for Android, which is available in UPDD 6. This implementation supports the Android operating system on x86 and ARM7 hardware. These notes should be followed to install UPDD on Android platforms. The file names of the Android packages are listed in Downloading UPDD.

System requirements

These are the system requirements for the standard installation to work:

ComponentRequirement
ProcessorIntel or ARM7. The software is implemented using the Android NDK, i.e. with native code, and is therefore bound to a specific architecture.
VersionThe ARM software was initially developed and tested on Android 6.0 Marshmallow, the x86 on 7.0 Nougat. API release 21 is required, so in theory this build will be supported with all Android versions from 5.0 Lollipop onwards. Later versions of Android on the same processor architecture should be supported, but this is subject to verification.
System interfaceThe touch interface uses the uinput interface, a feature that allows access to the kernel's input subsystem from user mode. Unlike UPDD drivers for other Linux variants this is the only mode supported.
Touch deviceUSB as supported in the supplied driver package.
Access to TCP/IP port 4146The driver requires access to TCP/IP port 4146 for local inter process communication only (i.e. between the upddutils component and the driver).
Root accessGiven that the driver must be embedded you will need root access to the device, therefore root access must be enabled. Rooting allows full access to the device without any restrictions that may be applied. Rooting is best undertaken with caution. You will need to consult your device documentation or other information available online; this article provides a useful general guide to rooting your device.
Terminal emulatorYou will need access to a terminal emulator to enable access to the file system with standard commands. We used this emulator during development.
Writable mount point /systemThis is commonly set during the Android install. A number of configuration files must be placed in /system so this needs to be writeable. These configuration files can in theory be placed in other locations but this is not standard and is not catered for in the installation. Please contact us for further information.

Important

  • The install script provided performs certain steps based on typical Android devices. Given the potential risk of executing incorrect commands as a root user you should check that the steps this script takes are valid for your device. If you are unsure you should review the script and execute the commands it contains one at a time.
  • Touch-Base uses virus detection software on all of our systems, but recipients of the software should pass the files through their own virus checking software before proceeding with installation.
  • It is important to take care when working as superuser (after the su command, which requires a rooted device) as you can damage the system with incorrect commands.

Copying the package to the device

Prior to installing, the install package must be copied to a suitable location on the target device. The location must be on a file system that supports the Linux execute access permission; specifically this means that a location on an SD card cannot be used. The location /data/data/updd_install is suggested and the rest of this guide assumes this location. If you know how to create this folder and copy the install package to it, simply do this and skip to Installation.

Load directly from the web

This method requires that the device has an internet connection and some method to transfer the installation package. In the example below we use the curl utility to transfer the file. If you can satisfy both these requirements then this is probably the easiest method.

  1. Open your terminal emulator.
  2. Enter the command su to gain root privileges.
  3. Create and navigate to a temporary install folder using the commands
    mkdir /data/data/updd_install
    cd /data/data/updd_install
  4. Download the file, using your download link:
    curl "<download link>" > android.tar
    If curl: not found is issued then curl is not available and you will need to use an alternate method to transfer the installation package.

Load from a USB pen drive

  1. Copy the delivered file to a USB stick.
  2. Plug the stick into the Android device.
  3. Open your terminal emulator.
  4. Enter the command su to gain superuser privileges.
  5. Navigate to the USB drive using the command cd /mnt/media/<drive name>
    If you type cd /mnt/media/ then press the TAB key Android will list the available options; typically pick one starting USB. If you type the first few letters of the name and press TAB again Android will complete this for you.
  6. Copy the installation package to a temporary install folder using the commands
    mkdir -p /data/data/updd_install
    cp <delivered file name>.tar /data/data/updd_install/android.tar

Installation

At this stage you should have a folder /data/data/updd_install containing your install package, and a terminal window open. Execute the following commands:

su
cd /data/data/updd_install
tar -xf *

At this point you will need to execute the installation step. As stated in the important notes above you can either examine the content of the install script, e.g. with the command cat install.sh, and execute each step, amending where appropriate, or execute the script with the command ./install.sh

Install script summary

The install script performs the following actions:

  1. Sets the file system to be writable.
  2. Creates the folder /system/vendor/updd
  3. Copies the driver and related files to /system/vendor/updd
  4. Marks the executable files updd and upddutils executable.
  5. Creates the folder /system/vendor/updd/usrlib
  6. Copies the associated library files to /system/vendor/updd/usrlib and /system/vendor/updd/qt
  7. Installs the device definition scripts to /system/usr/idc
  8. Creates the folder /data/data/updd
  9. Creates a backup of /init.rc as /system/vendor/updd/init.rc.orig
  10. Sets the file system back to read only.

It might be useful to refer to Troubleshooting at this point to check that all embedded components are working as expected.

Finally, in order to use the driver the integrator must arrange for the process to be launched at startup, as described in Driver execution.

Installed components

The UPDD Android package consists of the following main components, installed in these locations:

ComponentNamePathNotes
Install scriptinstall.shn/aNot installed
Driverupdd/system/vendor/updd
Settings databaseupdd.db/data/data/updd/db
Bootstrap settingsupdd.ini/data/data/updd/Manually created as required
Helper scriptupddenv/system/vendor/upddHelper script to execute UPDD tools
Start driverstartupdd/system/vendor/upddSets the environment for and runs the driver
Command line interfaceupddutils/system/vendor/updd
Qt configurationqt.conf/system/vendor/updd
Qt library filesqt/system/vendor/updd/qt
UPDD API folderapi/system/vendor/updd/apiAPI files used for developing UPDD client applications
User libraryusrlib/system/vendor/updd/usrlibShared library files

API folder
upddapi.h, TBGestureAnalysisTypes.h, gesture_event.in

User library
libgnustl_shared.so (C++ standard template library)
libusb1.0.so (USB interface)

Qt library
libQt5Core.so, libQt5Widgets.so, libQt5Network.so, libQt5Gui.so, libQt5Xml.so, libQt5Sql.so, libqsqlite.so (in /system/vendor/updd/qt/plugins/sqldrivers/)

Driver execution

After installing the driver it must be executed. Due to the wide range of Android targets, some of which actively block the installation of native executables, there is no single method to achieve this; a method appropriate to the target system must be selected. The following are some example methods.

Run directly from a terminal

Enter the following command in the terminal:

/system/vendor/updd/upddenv /system/vendor/updd/updd -e

This is useful for initially evaluating the driver. The command must be re-entered if the system is restarted.

Using Tasker and other third party tools

The Tasker tool provides a simple method to launch processes. Configure it to run the command /system/vendor/updd/startupdd at system reboot time. This method is useful for deploying to small numbers of devices. Other tools that may be of interest: init.d scripts support; Universal Init.d APK. All these tools are used at your own risk.

Android init system

In principle adding the command /system/vendor/updd/startupdd & to the file /init.rc will launch the driver at startup. However, the root location ( / ) is not persistent, so any changes are lost on reboot. There are 3 possible approaches:

  1. If the system init.rc (or any file referenced by it) is on a persistent storage location (e.g. /system) then the referenced file can be edited.
  2. If you have access to the boot image file boot.img you can unpack it, edit /init.rc and repack it as described in this article. The boot.img file contains content that is copied to / at startup.
  3. If you are building the Android kernel from source you can prepare init.rc with the required edit prior to building.

If viable for your system, this approach is useful for deploying to a large number of target devices.

Using the UPDD utilities

With Android we supply only the driver and the command line utility. The command line utility is included as a means to adjust the software settings and list driver and controller configuration information, and is invoked as follows:

cd /system/vendor/updd
./upddenv ./upddutils [parameters]

The script upddenv is used because UPDD components use shared libraries. Given these libraries might conflict with files shared with other applications, a private copy is used and these are not stored in the system library path ($LD_LIBRARY_PATH). The upddenv script prepares the environment for the current session only to include the path for these libraries. This example shows the basic use case:

cd /vendor/updd
./upddenv ./upddutils supported
./upddenv ./upddutils devices

In some cases it can be useful to create a Bourne shell with upddenv, to avoid repeatedly entering upddenv or in cases where arguments not supported by upddenv must be passed, e.g.

cd /vendor/updd
./upddenv sh
./upddutils devices
./upddutils get "*"

Calibration

The driver reads calibration data from the device's HID report descriptor so in theory should be calibrated once the driver is running. However, should calibration be required the command line utility can be used to perform a simple corner calibration by running the command ./upddenv ./upddutils calibrate. You will be prompted to touch the corners of the screen; touch as close as practical to the corner.

Troubleshooting

This section lists a few useful commands to check everything is working as required or identify the problem area.

USB configuration

The driver is custom built for specific touch devices and will only work if an appropriate device is connected to the system. For USB the device is identified via the USB vendor and product id.

  • upddutils usbdevices lists the USB devices on the system, or use the lsusb system command.
  • upddutils devices indicates if a device has been detected.
  • upddutils pnpinfo indicates what devices are supported in the installed driver.
  • upddutils digitizer_events shows touch data received from the controller.

These commands are described in upddutils command line reference.

Running the driver

Only do this if you have run the installation steps and not restarted the system, or you suspect the driver is not running. After a restart the driver should be working. The system command ps | grep -i updd can be used to list the UPDD processes that are running. To manually run the driver in a terminal emulator:

cd /system/vendor/updd
./upddenv ./updd -e

The terminal emulator will now be running the driver and will not respond. Open another terminal emulator window to enter other commands.

Check the driver is activated

Run the command line interface utility to check that the driver is activated and the API interface is working:

cd /system/vendor/updd
./upddenv ./upddutils devices

The devices option should list the touch device and the terminal emulator should return to the prompt. You might see an error at this point. For example unable to open connection to driver suggests that the driver is not running. If you have run the driver manually as above, recheck you did this correctly. If you have modified the system to start the driver, check this is running as expected; i.e. if you modified init.rc you should start by checking the entry in this file. If all is OK you will see your touch device listed. If not, check the driver supports the USB touch device:

cd /system/vendor/updd
./upddenv ./upddutils pnpinfo

This lists the USB devices supported by this package.

Driver debugging

If you need to raise a ticket with Touch-Base at https://www.touch-base.com/contact, please attach a driver debug log. To generate this log execute the commands:

cd /system/vendor/updd
./upddenv ./upddutils filedebug 3

The log file /data/data/updd/updd.log will be created. If this command fails, such as upddutils being unable to communicate with the driver, you will have to create and edit updd.ini as described in Logs and driver debugging to create the bootstrap log at system startup.

Debug output

Debug text output will be seen when running the driver or utilities in a terminal window. This is caused by a harmless link issue and does no harm other than to print out some warning text:

Uninstall

To uninstall the driver software you need to manually reverse the installation procedure. Open the terminal emulator and enter these commands:

su
mount -o remount,rw /system
rm -rf /system/vendor/updd
rm -rf /data/data/updd
rm /system/usr/idc/updd*
mount -o remount,ro /system

Remove any driver start-up method you may have implemented.

Limitations

UPDD 6 is a single source cross platform driver. Full functionality is available in the common desktop operating systems; when ported to other operating systems most core functionality is supported except as noted below. The main limitations that apply to the Android implementation are:

  • Extended features provided by the UPDD Daemon are not available.
  • No GUI applications are available, such as test, configure, calibrate etc.
  • Only the USB interface is supported, custom built for a specific device as required.
  • Only the uinput touch interface is supported.
  • The upddutils monitors command is not supported.
  • Multi-monitor support is untested.

For review

  • Dropped: the KingoRoot tool recommendation and the rumour about it (an unverified claim about a third party product); "If there is sufficient interest an Android service based implementation ... will be developed"; "Functions supported by this UPDD module will be added as and when required"; "we hope to address [the link issue] in a further release" (no promises in the docs).
  • The support mailto link became the contact page. The static curl http://xxxxxxxx.armeabi_v7a-06_00_NNNN.tar example became a placeholder for the customer's download link.
  • The 7.1 source still has Q_OS_ANDROID branches (e.g. updd/linux/osconnectorlinux.cpp, updd/upddmessagedispatcher.cpp:2136). The outline treats Android as UPDD 6 only; confirm no UPDD 7 Android package is offered.
  • filedebug 3 and /data/data/updd/updd.log are carried as written for UPDD 6; the 7.1 log location rules (features review E9) were not checked for Android.
  • Deliverables (50475, owned by downloading-updd) are linked, not repeated. The Android ids in live-topics.json match the outline's list.