On Friday, July 8, 2011 1:02:18 PM UTC-4, KASIRAO VELUGU 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?? > > 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
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. -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
