I am trying to implement a very simple hack.
Suppose there are 2 android phones which are connected via wifi and I run an app in Phone B which sends events to phone A like a pinch / swipe / turn.
So conceptually I would have to write an app which opens a socket and whenever there is an event sends an ioctl to kernel driver which injects these virtual events into android input subsystem
I just dont know what part in android that I need to push virtual events any help would be welcome
You need an rooted device as Phone A, look on this answers:
How to simulate touch from background service with sendevent or other way?
How to simulate a touch event in Android?
and:
Programmatically Injecting Events on Android – Part 1
How to compile Android Application with system permissions
Instruction for compile here
Related
I have viewed many unofficial MiBand SDKs in Github. (e.g. https://github.com/Freeyourgadget/Gadgetbridge) None includes detect when button touching, but I have viewed apps to detect this feature.
For example Mi Band 2 Func Button.
Also I have tried sniffing bluetooth data traces, but just show data because mobile device is not rooted and I haven't rooted.
Is there any way I can detect the touch of a miband button?
Thanks a lot!
You can listen if there is any touches event on the Mi Band device.
Assuming that the app authenticated...
Start notification to UUID_CHARACTERISTIC_DEVICEEVENT characteristic (In my case it's "00000010-0000-3512-2118-0009af100700")
and you shall receive '\x04' if the device touched.
I have a problem in sending touch events to Android (not to a specific application, system-wide touch events) through bluetooth.
I know that there are similar questions, but I still could not find the solution. I will be really happy if somebody helps me on this issue.
You can find details of my problem below :
Requirement :
To send remote touch events to Android (without root) through bluetooth.
Possible options I discovered so far :
1) Use of ADB commands - This is possible via USB cable and over network connection; however it is not allowed via bluetooth. Workaround I thought of :
To write an Android application with a background service which listens for Bluetooth inputs; and once it receives input, it runs ADB commands within the app itself. However, I think this requires rooted Android.
2) MonkeyRunner - I think this is also not possible through bluetooth.
3) Accessibility Service - According to my research, writing an accessibility service may be a solution to simulate touch events only when specific conditions are met (e.g. view clicks). But I need to initiate the touch from an external bluetooth device, without waiting for a specific condition.
4) Connecting the external bluetooth device as a HID (e.g. mouse) and simulate the touch on mouse button click. But in this case, the mouse pointer will always be visible to user. I also could not find a way to hide the mouse pointer. There are some tutorials to customise the pointer (e.g. a bigger one), but as I saw transparent mouse pointer is not supported.
I found an application called AutoInput (a Tasker plugin), which simulates touch events, but I could not get any feedback about how it works actually, I could not find how it simulates touch events.
Thanks in advance for your help.
Regards
I'm trying to get my computer (Mac/Linux) to send touch commands to my Nexus 7 tablet via ADB. I've found that I can successfully send touch events via "adb shell input tap x y", but the noticable delay is inhibiting what I can do. I would need to be able to send several per second, but this method sends at about 1 per second. I'm hoping to in the end control the inputs via a python script on the host pc if that's possible.
Thanks!
Have you taken a look at monkeyrunner?
Or if you are looking for an automation test framework, you could try robotium.
Update(2013.08.15) : I managed to emulate touch event using 1. adb shell (slow), 2. Monkey tool(fast but not satisfying) and 3. monkeyrunner (best because I can couple it with python)
I'm trying to create an external device (probably using raspberry pi) which acts as input device for android. Specifically, I want the device to create touch event(touch, swipe... etc). The touch event should be created not only when certain app is activated, but also in background.
I have thought several methods of doing it.
Create an app(probably service) which receives data from the input device and emulate the touch event.(Probably monkeyrunner?)
Connect the android device to the external device and use adb to directly create touch event.
Make the device to mimic the behavior of joystick (I heard that this method only applies to several game apps. is it true?)
Which is the most viable method? Or is any of the method possible? (On rooted phone probably)
PS. For solution 1, I saw several apps (Remote desktop-like apps) which creates touch events using S/W. How does it work?(Using Android API, use adb or misc. methods... etc.)
Thank you for reading this question.
I am writing Bluetooth mouse driver app for android. I want to know is that possible to implement mouse cursor in same fashion as on desktop?
What I have done so far is that I have connected my HID mouse to android device via Bluetooth. Mouse is sending reports to device and the Intent service receive it and parse it broadcast x and y coordinates. Now I want to display cursor with same functionality as on desktop.
Is that possible, and if so, how is it done?
Yes, it's been done, and mouse support is included in android from 3.1 up.
Just wait for an update to your device.