I want to make an app in android which acts as a bluetooth keyboard/mouse to Pc. What is the Api available in android for this purpose and what are the ways of implementing it.
First you need to capture user touch events. Show a dumb view and then override this method in your activity.
Then, you have to send the events via usb. Read more here. I'm not sure if the PC is the host or the accesory in your case, but a plain PC won't use the Android Accesory Protocol. You'll probably have to write a "driver" to your app.
UPDATE:
Read here for an awesome approach using regular sockets and adb port forwarding.
Check out http://developer.android.com/guide/topics/usb/adk.html
Related
I'm having the following scenario:
On the PC i will have a program running: java or .net, haven't decided yet.
When a certain event happens on PC i want to notify the android device.
I want a solution as independent and reliable as possible.
Opening a server on the PC/Android i think is out of the question because the user might be behind a router or on GSM internet (as far as i know it can't open ports as server)
The solution i have at this moment is to have a web server on the internet and have it handle the job, but i'd like not to use this because the delay between checks should be around 5 seconds, and i expect to have about 2-3k users simultaneously, and that will probably know down a regular web server.
So, any ideas how this communication can be made?
You may consider the option of Bluetooth client server application since PC and Android device usually have Bluetooth. You will have a Java server running on the PC and an Android client on the device. Check out this post: Send text through Bluetooth from Java Server to Android Client
You can handle the situation where Bluetooth is not available by creating a failover mechanism using REST API & JSON.
If you're already a web developer, I think creating a light HTTP based REST or JSON service would be a great solution. You've already said you don't want to do that which leaves the option of rolling your own client/server set up.
On the Android side of things, one way to do it would be to use TCP sockets. You can learn more about them here: http://developer.android.com/reference/java/net/Socket.html
I want to transfer messages/file from desktop application to the Android device. My question is that can I connect desktop Wifi device with the Android WiFi device without any use of internet connection. I want to use it just like Bluetooth. Is this possible/feasible or not? If it is possible then how can I implement it? And what is the message limit to transfer message/file?
Note : I wanted to use it as real time application.
Kindly suggest me any good approach and if possible then how to do that.
Thanks and Regards Dhaval
Wifi Direct will solve your problem, but there are no public API's available yet for developers. You will have to wait until Google releases it (hopefully soon). Some more reading:
http://www.sfonge.com/forum/topic/when-will-android-open-wi-fi-direct-api
http://groups.google.com/group/android-developers/browse_thread/thread/eb62f0aa0eccf161
Have a look at the Android Notifier application and it's sourcecode.
If you either convince your PC to function as a wireless access point, or obtain a wireless access point, you can set up a network connection between the PC and an unmodified android device. Note that it is not necessary for their to be an upstream Internet connection feeding the PC or access point.
You would then need to write a server running on the phone which listens for inbound TCP connections from the PC. Any android application with internet permission can do this, provided that you use a port number in the unprivileged range. You may have problems with the wifi timing out and shutting down, so you may need to use a timer to periodically trigger a small network operation (ping the access point, etc) to keep it awake. Note that this will use up your battery (what android wants to shut down an idle wifi to prevent).
If you can get both the device and the PC to work with an "ad-hoc" wireless connection you would not need the access point or PC to function as one, however last I heard this required root-level mods to the android device.
i need functionality like..connect android device to external usb device using RS232 interface.
also receiving / fetching data from external USB device to my application. this type functionality possible in android ? which step follows for this type of functionality ?
Not directly: however, this will probably let you do what you want.
http://www.sparkfun.com/products/10585
Its a combination USB host controller and Android API that uses the ADB protocol to pass data. Alternatively, you can also look at this:
http://code.google.com/p/microbridge/
Which needs an Arduino and doesn't appear to be that cleanly integrated but should also do what you want.
This is more of a general question i suppose...
I am looking to start to make an app which will connect to my pc via bluetooth and then control my mouse. I am wondering if any people know where to start or know of any places to get a tutorial from. I know basics about how to connect via bluetooth to a device, but dont have a clue where to being with motion conrol tutorials etc
thanks
I imagine that you'll have to write an application on your pc that would communicate with the device and also with the mouse. There might be some sort of pc-side UI testing apps (analogs to Monkey) that you could harness for this.
You can use tomcat Apache server or any other server which will receive mouse events sent from android mobile.
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!