7

I need to create an application that control PC mouse(pointer) through android device without downloading a server on pc, it should be able to communicate directly with my pc I already checked out the remote droid application but the user would need to download a client server to communicate with the phone

so is there way to remote control pc mouse through phone without downloading a client server on pc?

note: I am working on android 2.3.3 thus i cant use wifi direct and usb accessor

Venkatesh Achanta
  • 624
  • 1
  • 14
  • 31
abuasis
  • 94
  • 1
  • 2
  • 5
  • 1
    it's possible over bluetooth. Take a look at bluetooth HID. – Fredrik Feb 12 '12 at 13:19
  • I found an app on Google Play that claims to do this, although I'm not sure if it works -- [link](https://play.google.com/store/apps/details?id=io.appground.blek&gl=US) (however, the app's source code is not publicly available) – user202729 Nov 06 '20 at 14:19
  • See also: 1. [android - Can a phone pretend to be a Bluetooth keyboard? - Stack Overflow](https://stackoverflow.com/questions/8483246/can-a-phone-pretend-to-be-a-bluetooth-keyboard); 2. [Can I emulate a Bluetooth keyboard with my Android device? - Android Enthusiasts Stack Exchange](https://android.stackexchange.com/questions/4538/can-i-emulate-a-bluetooth-keyboard-with-my-android-device) – user202729 Nov 06 '20 at 14:33
  • Somewhat related: [Is it possible to program Android to act as physical USB keyboard? - Stack Overflow](https://stackoverflow.com/questions/9805731/is-it-possible-to-program-android-to-act-as-physical-usb-keyboard) (possible, but also need root access) – user202729 Nov 06 '20 at 15:00
  • Also related: [Android - Bluetooth Low Energy Remote Keyboard & Mouse - Stack Overflow](https://stackoverflow.com/questions/21153444/android-bluetooth-low-energy-remote-keyboard-mouse) – user202729 Nov 09 '20 at 04:58

5 Answers5

3

Why not just simulate regular bluetooth mouse, a standard bluetooth mouse which has its drivers as part of most os's. no one can control your pc remotely without bluetooth pairing. in theory i think it should be possible, but it requires knowledge in hardware and low level software (so its not a task suitable for most developers).

sciffer
  • 31
  • 2
1

It doesn't matter what the client is, the fundamental question is "Can you move the mouse cursor on your PC from anywhere without installing software"

The short answer is no - which is a good thing! Otherwise, anyone on your network could just take control of your PC...

That said, you could, in theory, create an RDP (Remote Desktop) connection and use that to control the PC as a whole - but that is very complex, has been done already and would still require the user to allow remote desktop connections to the computer (Control Panel->System->Advanced->Remote)

Edit - Bare minimum app:

There are a number of ways to approach this but the absolute simplest app I can envision involves having an application on the PC listen for connections on a TCP/IP port. You'd then send messages to this port from Android using the Sockets classes.

The app would receive these messages, parse them and perform the appropriate mouse actions.

Make sure that you include an authentication/authorisation mechanism - you don't want random strangers to be able to control your PC just because they broke your wifi.

You may find it easier to build the desktop app to accept messages using the HTTP protocol (RFC) - This is a standard, widely used and very flexible mechanism for client-server communication. Why reinvent the wheel? This would also make your Android-side code far simpler as you could use HttpURLConnection and other similar classes which abstract the complexity of managing sockets.

You may also want to consider if the app should provide any feedback to the client - eg the new mouse position or a success/failure.

NB: Running the app as a windows service or website might seem preferable to a desktop app (doesn't need to be started by the user, nothing in taskbar/system tray) but there are considerable drawbacks to both - Windows services can't interract with the desktop easily (what happens if nobody is logged in?) and websites run as a different user so in addition to not having the same desktop, they have limited permissions.

Basic
  • 26,321
  • 24
  • 115
  • 201
  • Thank you for your help , if that is the case what can i do to allow the user do the minimal setup procedure on the pc side but still grant the phone permission to control pc – abuasis Feb 12 '12 at 12:20
  • Edited again to add some useful links. One other thing to consider: What PC(s) is this targetting? Windows? MacOS? Linux? Unfortunately, controlling the mouse is usually quite a low-level operation which means each operating system does it slightly differently. I haven't tried it but imagine writing a single app to support all 3 would be difficult if not impossible - so you may need to support multiple apps. – Basic Feb 12 '12 at 13:16
  • 1
    You covered everything except bluetooth which is the only way to solve it. Works the same way for Linux, Windows & OS X. Make a HID driver and connect to whatever computer you want to. – Fredrik Feb 12 '12 at 13:27
  • @Fredrik Bluetooth may work the same across all three platforms but a HID driver doesn't, also bluetooth is still not prevalent on desktop PCs – Basic Jul 10 '14 at 09:49
  • That answer is utterly false. I had a watch phone which could control the mouse once the phone and the computer was sinced on bluetooth. It worked on pc and mac, without the need of a server on the targetted computer. – sidney Dec 17 '14 at 10:44
  • @Basic thanks for your answer, you could have then have updated your answer to take it into account. Nothing personnal, but your comment is inconsistent. – sidney Dec 17 '14 at 16:37
  • @Basic, I didn't upvoted any other answer. You took it personnaly for answering my comment and said that my coment is a duplicate even though it isn't one. This is not a game. There is no valid answer here, and you are not compliant with it. – sidney Dec 18 '14 at 12:47
  • @Basic if you were rights, people shoud not be able to comment on thread. You began replying to my comment. And right now, this is offtopic. I replied cuz people should now that this answer is wrong. I explained earlier why. And my comment is not a duplicate. You are trying to have the last word, if not, don't answer to this. – sidney Dec 18 '14 at 16:54
  • How is it not a dupe? Someone said use Bluetooth. So did you... Anyway, I suggest we both delete these comments to remove what is basically noise for anyone else. Leave your downvote so you can feel it's a victory. – Basic Dec 18 '14 at 18:34
1

It might be a case that i misunderstood the point. I think however that you can play with the BT protocols. If you find a way to recognize the phone form the pc like a BT mouse you can control the pointer. I think some of the low end SonyEriksson phones had that option build in.(SE880i). Though I am not sure how the driver problem will be solved.

Regards TT

TsT
  • 11
  • 1
0

If it is possible to plug into PC's USB
Then

  1. Arduino mouse using a cheap Arduino board https://www.arduino.cc/reference/en/language/functions/usb/mouse/

  2. Arduino wifi or bluetooth using same or another board (or connect by Serial, UART, SPI, I2C cable).

  3. software on cell phone (Android) to connect to wifi/bluetooth

  4. Some hacking at the C level.

Notes
- no driver on the PC
- Could do the same with PIC32 (even with PIC8/16 but might take longer).

This is a typical real world IoT type project. As a project it is between 40 and 160 hours to demo prototype for an experienced consultant. Parts cost estimate under $400 besides cell phone cost.

120 to 500 hours for 20 production prototypes + layout and assembly cost about $4000. Production target unit cost under $25. In other words a neat Kickstarter project.

Experienced soft/hardware & lucky hacker could do it 24 to 36 hours.

LOIS 16192
  • 101
  • 2
-1

In Micromax q2+ Iam able to access the bluetooth - remote control and after pairing be able to move the mouse to my pc. One thing is am unable to do any action events.