controlling hardware device through android emulator

125 views
Skip to first unread message

KASIRAO VELUGU

unread,
Jul 8, 2011, 1:02:18 PM7/8/11
to Android Linux Kernel Development
My project is controlling some hardware device (like RFID kit) from
Android Emulator which is installed in a PC... But i am not getting
how to control the external hardware which is connected to PC from
Android Emulator.... Can u help me on this topic??? Is it same doing
project under windows and Linux??

I have written some code using android.hardware.usb package (which is
available in Android 3.1) ... but it is not detecting the hardware
devices attached over USB

hedwin

unread,
Jul 9, 2011, 2:30:48 PM7/9/11
to android...@googlegroups.com
The android emulator is qemu based, do a google search on qemu and usb support maybe that will provide a lead.

Cheers,

Hedwin


Chris Stratton

unread,
Jul 16, 2011, 9:35:56 AM7/16/11
to android...@googlegroups.com

That's an odd project, in that it's not very clear how it would escalate to anything usable from a hardware android device.

A possible solution would be to partition your code into two pieces, one UI dependent and one hardware dependent, and connect them through an abstraction barrier, which would initially be a network socket.

In the emulator case, you would build the hardware dependent code for the development machine's host operating system and run it on that machine.  The UI code would be a normal android application running within the emulator, and opening a network connection to the other half.

If you escalate to a hardware android device, you would either build the hardware dependent code into the android platform (and keep talking to it over a network socket, or use some more android-typical means of IPC such as the service model) or you could potentially fold it into your application.

If reasonably possible, passing all of your hardware interface needs through an abstraction interface will buy you a lot of future flexibility in the possibility of changing platforms, hardware devices, swapping out UI's, and debugging only one piece at a time against a known-good remainder.

 

vame

unread,
Jul 23, 2011, 11:34:19 PM7/23/11
to Android Linux Kernel Development


On Jul 8, 10:02 pm, KASIRAO VELUGU <kasi...@gmail.com> wrote:
> My project is controlling some hardware device (like RFID kit) from
> Android Emulator which is installed in a PC...  But i am not getting
> how to control the external hardware which is connected to PC  from
> Android Emulator.... Can u help me on this topic??? Is it same doing
> project under windows  and Linux??

Did you try changing the ADB settings where it lists down the device
you want to add to your emulator?


>
> I have written some code using android.hardware.usb package (which is
> available in Android 3.1) ... but it is not detecting the hardware
> devices attached over USB

Is your RFID kit getting detected in the host machine?
if yes, then as what node? What is the interface(USB, serial)?
Are you using any converters in between?

If you are able to see you device detected on host side but nothing
on emulator then as Chris mention you may have to re-consider your
design.
However 1st step would be to check if the host is detecting the RFID
kit.


--
vame




Reply all
Reply to author
Forward
0 new messages