I am writing an Android 2.1 application that needs to get data from a USB device. The USB device is an embedded system i created. The embedded system has no OS. Also, the android device does not send any data to the embedded system.
How should i go about this, I'm guessing i will need to make a high-level driver to communicate from USB to the application. But, i have never made a Linux driver before.
If creating a high-level driver is the best way to do this, can someone give me some references so i have somewhere to start.
If there are other ways to accomplish this i would also like to hear about it
-Thanks
The Android Open Accessory Development Kit is where you should start looking. Like many of other Google's documents, the tutorial is reasonably complete and should provide you with a good starting point
Good Luck!
I think you will need to recompile Android kernel to add usb device support.
It can be an option if you are working on some dedicated project and only one Android phone should be supported. If you want to support all kinds of Android phones, I can suggest to implement USB host in your embedded system( if it is possible), thus your Android phone can be connected using ADB protocol.
Related
Basically I would like to plug in my Android phone to a Linux computer and have it appear as a USB video device such that it can be seen in /dev/videoX and can be opened to capture video / images using the phone's camera.
Are there any specific hardware / Android limitations that would make this infeasible?
What are the general steps involved in making this happen (if at all possible)?
Can it be done as an Android app or does it require completely modifying the Android / kernel?
I assme you want to use your Android Phone as Webcam? There's an App for that. I believe Droidcam was it called. Check it out here:
Droidcam Instructions for Linux
As far as I know, /dev/video0 , /dev/video1 and so on are devices that show up for drivers are based of the V4L2 (Video For Linux Version 2) subsystem.
What are the general steps involved in making this happen (if at all possible)?
The naive developer way would be to write a USB driver that recognizes your phone and registers a V4L2 driver for it. It could be an empty driver.
Can it be done as an Android app or does it require completely modifying the Android / kernel?
I suppose you could build a loadable module (ko) for this.
Please re-purpose your question to what you really want to achieve, as this may not be the right way of doing this.
I want to connect my Xbee module to my android phone and communicate with it by sending AT commands.
I do know of the USB host facility provided by Android phones, but I do not know how to send data to it.
I have the java-Xbee API and I am able to talk to the Xbee using my computer but since my project involves using the Android OS, any help on this topic will be appreciated.
According to this Google Code Page, the java-Xbee API requires Java >= 5 and RXTX. Considering those two requirements:-
RXTX on android is not an out of the box lib and may require some hacking which may or may not work.
I'm not a Java VM expert, but i know desktop OS JVMs work differently from Dalvik.How well would Dalvik run code developed for JVM? Here is a nice StackOverflow topic discussing the two.
Faced with the above challanges, are you brave enough to boldly go where no man has gone before?
Could you also consider the following well documented and supported approaches:-
Ytai Ben-Tsvi & Sparkfun's IOIO-OTG
Saves you the headache writing android 3.1+ USB host code and thus allows you to use cheaper phones that run droids 1.5 to 2.3 (without hacking the latter).
Digi's WiFi to Xbee
Allows you to link your android phone (or any other programmable wifi enabled computer) to your device over the internet.
Now that the Android APIs support working directly with USB devices (since 3.1), I am curious if there has been any work to create "soft-mode" drivers for some of the more popular class-compliant devices (such as audio or HID).
In other words, are there any open source projects that wrap up more useful communication with specific classes of devices into a Java class that can be added to an Android project?
For my purposes, I am specifically interested in USB audio, but it seems that a community-built set of classes derived from Linux kernel module sources could be beneficial to many projects. My hope is that others have thought of the same thing and have already began work. Any pointers in this direction would be most appreciated.
A few more resources that I have stumbled on:
User mode USB isochronous transfer from device-to-host
Audio Evolution seems to have built their own userland driver somehow
I have started work on an IRDA driver stack over USB in user space.
I am working out the basic plumbing but as far as I can see if I can create the equivalent user space driver to the linux kernel drivers such as the STIR4200 driver then I "ought" to then be able to port over existing IRDA protocol stacks such as JIR.
We shall see...
How do you effectively develop, debug, and test an android app that is based on Bluetooth.
I have been googling and searing stack overflow for the answer to this question and I am not getting a clear answer.
I understand that the emulators do not support Bluetooth. I also know of various guides explaining the functions, classes, and such, and I know people have mentioned that setting up a Bluetooth emulator is possible with Virtualbox. I even came across some old projects like BT-Sim that seemed like a way to create fake BT signals (though if my android emulator doesn't support BT, it doesn't help too much)
But no solid guide on how to get this going. It just likes a few scattered puzzle peaces that need to be stitched together. It makes me wonder how app developers reliably make BT enabled apps?
Are there any guides that dissect how to do this process? I imagine the steps to accomplish are:
Create a custom emulator on Virtualbox that can simulate Bluetooth?
Get the AVD Manager to talk to this emulator so my compiled Android code will work with it
Run a Bluetooth simulator to send BT signals over a port in your computer
(I don't really know how to do either of those 3 though!)
My overall goal is as follows:
Create an app that will collect data from a Bluetooth transmitter
But first, create a simulator on my computer that can talk to my android emulator as if it were the real thing
I'll be honest, I do find it odd that the Google folks don't allow Bluetooth emulation on their AVD. I understand not allowing real telephone calls, but I don't see how Bluetooth can be abused like that.
Anyway, any help in setting up Bluetooth would be greatly appreciated and hopefully help many others out there!
NOTE: I am using the standard Eclipse + Android SDK setup with AVD to do my Android development. Planning to use API 10. However, if I need to use a different set up, I am fine. As long as it comes with a step by step guide! That would be very nice.
Old question, but it's still unanswered. If you have a physical device, that seems easiest way to go. If, like me, you don't have a device it's still possible to develop with bluetooth and android.
Download an android x86 iso, load it into virtualbox with bridged network setting and install it.
Plug in your bluetooth dongle and select the device from the 'usb' menu, alternatively you can set a device filter in the vm's settings page.
Now just use adb and connect to it, you can find the ip by going to console (alt+f1) and typing netcfg or ifconfig eth0. You may also need to type adbd on the android console - I do, but I don't see many people mention it so seems it's not always needed.
It still works with eclipse, and is much faster than the emulator. Even when I'm not doing bluetooth dev I use the vm rather than the emulator.
Well, I believe this should be able to be implemented on the Android.
Recently, I found some Android developers created the Android remote controller(KB/MOUSE) app by
installing an app onto the server side(could be Windows or Mac or Linux) system and interact each other by bluetooth.
However, I believe it shouldnt be necessary to install an app onto host side if
we can take advantage of standard Bluetooth HID profile.
I have implemented the Android Bluetooth HID application which can make your android device play as a bluetooth kb/mouse input device.
to control my Ubuntu without installing any host side daemon.
The engineering approach involves Bluez deeply so it doesnt work on Mac or Windows.
Please bear my lack of bluetooth knowledge. I am really curious about the possibility of this matter.
If any of you has any approach or idea about this, please kindly share.
Thank you.
well, it seems this question is not yet implemented by the developer.
However, if any of you is interested in how to do this for Linux system. Feel free to write me an email. I would be happy to share the skill.