This is an Android app I designed to make my Waveshare 5inch Raspberry Pi touchscreen work with android and Odroid C1+,
but it should work for any screen that uses the XPT2046 chip (and possibly ADS7843/ADS7846 chips) and Odroid C1, C2, C4, N2, and XU4. These screens were designed for the Raspberry Pi running linux and nothing else.
The screen uses the XPT2046 chip for touch recognition, like many cheap Raspberry Pi screens online,
and of course, not much documentation is available. The only software I could find for it was for Linux. After doing
some research, I realized I would have to make my own driver. Unfortunately, it would be too much work for me to make
a proper driver for Android and for others to install it as well. The alternative is to make an app that talks to the touchscreen
and uses Android's native commands to inject gestures (tap, swipe). I found a
Java app on github that someone made to read touches and modified it
to work with a special version of the wiringPi library made to work with Odroids that have a GPIO. I also set this app up as an accessibility
service so it can be enabled by simply starting the service in Android Accessibility options and it starts when Android starts automatically.
I tried to make it work with other screen sizes other than 5inch so any screen with an XPT2046 chip can be used with this software. Supposedly the
Xpt2046 chip is compatible with the ADS7843/ADS7846 chip, so it might work with ADS7843/ADS7846 chips too.
The methods used in this app mean that touch gestures aren't going to be just like if you used this screen with a Raspberry Pi. It's not a real Android driver.
This app could be modified to use Android's accessibility gesture injection, which would be much better, but the Odroids use old Android
versions which don't have that feature. Also this could easily be modified to work with a Raspberry Pi by just switching the Odroid wiringPi library
with the Raspberry Pi wiringPi library.
Setup and calibration is done by setting the screen resolution and the touch resolution. The touch resolution should by 4096x4096
by default. You shouldn't have to change it, but you can if you need. You can also shift the X,Y coordinates if your taps are not on target.