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.
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 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
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.
anyone know if its posible to make an application to simulate a touchscreen mouse or trackpad by bluetooth??
How can I make that the PC (or MAC) knows me as a mouse device?
Regards,
Juan
You should have a look at the Bluetooth HID specification. It may be possible, depending on the stack of the device that you are using to emulate a mouse/trackpad. I'm not familiar with the stack on Android (assuming that's the platform you're using from the tag on your question) so I don't know if it's possible from there.
Essentially, you create a HID service on the L2CAP protocol. The service record specifies the HID descriptors which describe the data being sent from emulating device. The HID driver on the host computer should be able to interpret that data.
It might be useful to try to connect to another Bluetooth mouse/trackpad from the desktop (Bluecove on a stack other than Microsoft is a good way to hack around in Bluetooth). Have a look at the service record for the HID service on the mouse/trackpad. Also, look at the data coming from the mouse/trackpad for an idea of what needs to be sent and when.
Alternatively, you could write a server application on your computer that communicates via another Bluetooth protocol (e.g., RFCOMM/SPP) to the input-device emulator app running on your phone. The server application would simulate the input device (e.g., move the mouse pointer around on the screen, etc).
Instead of creating your own project why dont you contribute to the remotedroid project?
I'm assuming you know your bluetooth api's well. Remote droid uses Wifi and OSC messaging to communicate with the PC.
Yes you may use GlovePie with the wiimote connected to BlueSoeil, It will alow you to do anything with you computer with the wiimote. It also has a Language it uses
I think you want this:
Serverless Bluetooth Keyboard & Mouse for PC/Phone
It's even open-source!
Unfortunately it is not open source, it just has a GitHub readme for some reason.
But still the app is quite good!