Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to control pc mouse from android device without client server

Tags:

android

mouse

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

like image 803
abuasis Avatar asked Feb 12 '12 11:02

abuasis


People also ask

How can I control my PC mouse with my phone?

Download the Remote Mouse app (available on both iOS and Android devices) Install Remote Mouse Server on your computer (available for both Mac and PC) Connect your mobile device and computer to the same Wi-Fi network and then you're all set!

How can I use my Android phone as a mouse for PC?

Download it free from Google Play Store, open the app and choose 'Connect to PC'. You will get an option to connect your smartphone via PC with Bluetooth, Wifi and USB connection. Once connected, use your smartphone as a wireless mouse. Unified Remote is easy to use and is free to download on Google Play Store.

Can I control my PC with my phone?

With the Remote Desktop app for iOS, iPadOS, and Android, you can connect to and control a remote Windows computer to work with your files and applications.

How can I use my Android phone as a mouse via USB?

Install MyPhoneExplorer on both a Windows PC and Android phone. Connect by USB. Enable the MyPhoneExplorer keyboard installed as an input method. In the Extras menu on the PC mirror the phone screen, then you can type on the laptop to the phone.


2 Answers

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).

like image 147
sciffer Avatar answered Nov 22 '22 20:11

sciffer


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.

like image 38
Basic Avatar answered Nov 22 '22 22:11

Basic