![]() ![]() Once the configuration is done, simply run the tool like this: java -jar adbcontrol.jar phoneImageFilePath – the location on the phone where the screenshot file is stored before downloading it.This path tells it where to store the file on the local system before displaying it. ![]() localImageFilePath – the tool has to download the image file from the phone.Note that the actual grabbing process will probably take considerably longer than this delay, so the update rate will be slower. screenshotDelay – the delay (in milliseconds) between displaying a screenshot and grabbing the next one.Linux users note that Java doesn’t seem like the ~ character in file paths to access the home directory. adbCommand – the full path to the adb tool as a shell command.It’s slow as hell (everything is being done through shell calls, which makes the screenshot updates particularly slow), but it works.īefore you first start it, make sure you have adb installed and modify the config file provided with the download. Capture mouse clicks and drags and forward them to the phone.Capture keyboard events and forward them to the phone.Repeatedly grab a screenshot from the phone and display it in a Window.I won’t get into how to setup and configure adb here – please check the official docs if necessary. But if you’re a programmer like me and have already access the phone via adb before, all you have to do is fire up the tool on the computer. If you didn’t, connecting the phone will open a confirmation dialogue on the phone – and without a touchscreen, you obviously won’t be able to confirm it. It uses adb access to the phone – meaning that you have to have the SDK tools installed and you have to have already confirmed the USB debug connection on your phone earlier. It requires no extra software installed on the phone, just a USB connection and the Java tool (Java 7 required) and SDK tools installed on the computer. I present it here in case someone else might face the same problem I did. I spent yesterday evening hacking together a crude Java tool to serve as a primitive remote control through an Android phone. So what does a programmer to when the obvious tool doesn’t yet exist? Write it himself, of course. Astonishingly though, nobody seems to have written such a tool. A combination of points 2 and 3 would be a way to actually simulate touch events in a useful manner.There are ways to get screenshots from an Android phone through adb – obviously after all, even the official Eclipse plug-ins provide a screenshot feature.Touch events require the exact screen coordinates as numbers, so as a standalone solution that’s still rather tedious. And the shell has commands to simulate key presses and touch events. adb (the Android Debug Bridge, part of the SDK tools) provides shell access to the phone via USB.And even they generally require some setup steps before they can be used – back to the start. Those that don’t generally can’t control the touchscreen/mouse. There’s a ton of remote control apps for Android (as was to be expected).What else then? A series of internet searches yielded the following results: Sadly, unlike the Nexus 5 (and the Nexus 1, if I recall correctly), doesn’t. So not only do I now have to decide whether to get a new phone or try to replace the screen myself, I also had to find a way to regain control over the phone so I could backup my data.Ī bluetooth mouse would be one way to control the phone without the touch screen, but I don’t have one – and even if I did, I didn’t have bluetooth turned on (though that could apparently be accomplished through the console).Ī USB keyboard would also be of help if the Nexus 4 had USB Host support. Doesn’t look so bad, but in fact the touch screen is completely dead. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |