1

Basic example, if I bought a chipset with a light socket and bulb soldered to the chipset; then put a USB cable with the mini-USB plug on the end to get plugged into the android phone. Can I write a Java application to turn on/off the light, get the status of the light(on/off) and maybe power a super-small led/bulb with power from the phone itself?

Any insight at all would be greatly appreciated. Thank you

user322865
  • 11
  • 1
  • 4

3 Answers3

0

If you need to do it in Java, I guess the answer is no. The SDK doesn't have that kind of low level functionalities.

In my short experience with Android, the only hack I did was connecting a Bluetooth keyboard and it was on a rooted phone running scripts in a console.

You can always hack the code, build your own android and provide that functionalities to an Android app, but I don't know if you want to go down that road.

Macarse
  • 91,829
  • 44
  • 175
  • 230
0

This is pretty new afaik

Sounds like there may be a java API for this sparkfun IOIO. Another option could be if you got some sort of board with wifi, you could always run a mini server that controls the led/lights through a web interface

http://www.engadget.com/2011/04/10/sparkfun-intros-ioio-for-android-a-hack-free-breakout-box-to-ge/

edit 2015: for anyone seeing this now USB-OTG is becoming pretty common on newer android devices and can be used as Host or Device as the question asks

0

Yes, you can.

Pick a usb device similar to things made by Phidget

Then take a look at how to put the phone in host mode

Rahul Sharma
  • 2,867
  • 2
  • 27
  • 40
michael
  • 2,577
  • 5
  • 39
  • 62