Android - PC communication
-
Hello everybody! I have a problem and I couldn't find a good answer anywhere. Let's say we have a WPF application written in C# running on a PC coupled to an Android phone via USB cable. The application must instruct some app on the phone to start and take a picture with the camera, process the picture in some way and send some text data back to the PC application (or maybe even the whole picture) How do you do this? One more thing: it must be done via USB so I'm not interested in answers related to WiFi or Web services or stuff like that. Thank you!
-
Hello everybody! I have a problem and I couldn't find a good answer anywhere. Let's say we have a WPF application written in C# running on a PC coupled to an Android phone via USB cable. The application must instruct some app on the phone to start and take a picture with the camera, process the picture in some way and send some text data back to the PC application (or maybe even the whole picture) How do you do this? One more thing: it must be done via USB so I'm not interested in answers related to WiFi or Web services or stuff like that. Thank you!
MadDoc79 wrote:
How do you do this?
Most likely by writing quite a lot of code. For a start you need an app on the mobile that listens for messages from the PC. It must then use the camera to take whatever pictures you require, and send them back to the PC. Google will find you resources on USB communication between Android and PC, and the Android app itself. See also Android articles[^].
-
MadDoc79 wrote:
How do you do this?
Most likely by writing quite a lot of code. For a start you need an app on the mobile that listens for messages from the PC. It must then use the camera to take whatever pictures you require, and send them back to the PC. Google will find you resources on USB communication between Android and PC, and the Android app itself. See also Android articles[^].
There are one or two options for the basic communication mechanism between PC and target Android device, for example adb commands (via USB) would allow you to send Intents (android constructs, which if you don't know what they are you need to start with basic Android training before trying to proceed). However, Intents - when used in this way - provide no mechanism to return data BACK to the PC, so your captured images could not be returned. The most viable solution that I can envisage would use a socket interface, also running over USB. This would give you a fully bi-direction transport mechanism. I have implemented such a system and therefore know with certainty that it works. As the previous poster said it's quite a big task, but I'd say not huge providing you know what you're doing. Good luck!
-
There are one or two options for the basic communication mechanism between PC and target Android device, for example adb commands (via USB) would allow you to send Intents (android constructs, which if you don't know what they are you need to start with basic Android training before trying to proceed). However, Intents - when used in this way - provide no mechanism to return data BACK to the PC, so your captured images could not be returned. The most viable solution that I can envisage would use a socket interface, also running over USB. This would give you a fully bi-direction transport mechanism. I have implemented such a system and therefore know with certainty that it works. As the previous poster said it's quite a big task, but I'd say not huge providing you know what you're doing. Good luck!
-
Sorry Richard, no you're right! Intended for the original questioner - my mistake.
-
Hello everybody! I have a problem and I couldn't find a good answer anywhere. Let's say we have a WPF application written in C# running on a PC coupled to an Android phone via USB cable. The application must instruct some app on the phone to start and take a picture with the camera, process the picture in some way and send some text data back to the PC application (or maybe even the whole picture) How do you do this? One more thing: it must be done via USB so I'm not interested in answers related to WiFi or Web services or stuff like that. Thank you!
There are one or two options for the basic communication mechanism between PC and target Android device, for example adb commands (via USB) would allow you to send Intents (android constructs, which if you don't know what they are you need to start with basic Android training before trying to proceed). However, Intents - when used in this way - provide no mechanism to return data BACK to the PC, so your captured images could not be returned. The most viable solution that I can envisage would use a socket interface, also running over USB. This would give you a fully bi-direction transport mechanism. I have implemented such a system and therefore know with certainty that it works. As the previous poster said it's quite a big task, but I'd say not huge providing you know what you're doing. Good luck!