The next video shows how is possible read/write an analog I/O (values between 0 and 1023) and read/write digital I/O (values 0 and 1). We have connected three leds to digital outputs and one potentiometer in an analog input. The potentiometer simulated all possibles values (0-1023 ~ 0-5v).
Arduino Source Code: ExampleBoardArduino.zip
Android Source Code: ExampleBoard.zipby