- Home /
Using an Android tablet as input device for a desktop app
I'm looking at ways to have the player use an Android tablet as an input device for a desktop Unity game (so it's basically a touchpad of sorts). Right now my options seem to be (1) finding an existing Android app that somehow communicates touch input to the desktop in some usable format (not yet found one), or (2) build a Unity app for Android that reads touch input, and somehow communicate that to my computer where the desktop Unity game.
My main concern is that it needs to be quite easy to set up and work reliably. Does anyone know if there are existing solutions? Or recommended ways to implement this myself? I've got some ideas of my own but I want to be sure there aren't easier solutions.
@meat5000: I'm not really looking for a joystick emulator, I want the solution to send touch input so I can detect things like pinching, swiping, tapping, etc.
You should check some of them out. Some do have different joystick and touch options, so some can just send touch info. Sometimes licenses will allow you to decompile the app to see how it works. Just don't go ripping code. You may find it requires native code on Android to control the hardware.
@Josh-Naylor: Yeah I know there are plenty of libraries to handle touch input on the device itself, but I want to communicate the touch input to the desktop app somehow. I'm wondering if there's a solution for that out there already, and not one that emulates joysticks or gamepads.
Answer by $$anonymous$$ · Nov 27, 2014 at 05:37 PM
I've done something like this in the past. Not using android or unity, but iOS. But the approach should work for your question as well.
The approach :
Create a desktop app.
Run a server on desktop.
Have a web API that communicate with the server.
Have a mobile app (android app in your case)
Communicate between server (web API) and mobile app (I was just sending some HTML requests with parameters appended to the URL and grabbing it from web api side of things and feeding it to the main desktop app)
Keep in mind that I was not using this for realtime input instead just passing commands to the desktop app from an iPad, as in 'Start app', 'close screen saver' kind of thing,
I know this is a pretty vague. Hope it helps though.
Yeah that was the idea I had if I'd have to implement it myself. HTTP doesn't really seem suited for continuous input however (like pinch-scaling etc), like you said.
Answer by tanoshimi · Nov 27, 2014 at 07:37 PM
Haven't personally ever tried it, but I'd probably try to use Bluetooth a la https://code.google.com/p/androhid/
Your answer
![](https://koobas.hobune.stream/wayback/20220613172544im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Touch Input madness 2 Answers
Android - touch a 3d object and something happens to it 1 Answer
Touch joystick tutorials ? 0 Answers
input touch android help 0 Answers
Touch Input in Android... 1 Answer