I'm starting to use the Android USB API to send data from an Arduino to an Android device. Is it possible to programmatically switch between send/receive data and just charge the Android phone?
I know that you cannot do both things at the same time, and, since you have to open a FileInputStream
in order to be able to receive data, as long as this is open the device won't be charged.
Will it be just as simple as closing this stream to charge again? If is as simple as it, can the Arduino then send basic information in order to ask the device to open the stream again?