Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. Android - PC communication

Android - PC communication

Scheduled Pinned Locked Moved Android
csharpandroidwpfwcfhelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MadDoc79
    wrote on last edited by
    #1

    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!

    L N 2 Replies Last reply
    0
    • M MadDoc79

      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!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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[^].

      N 1 Reply Last reply
      0
      • L Lost User

        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[^].

        N Offline
        N Offline
        Nick_3141592654
        wrote on last edited by
        #3

        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!

        L 1 Reply Last reply
        0
        • N Nick_3141592654

          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!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I do not think this message was meant for me.

          N 1 Reply Last reply
          0
          • L Lost User

            I do not think this message was meant for me.

            N Offline
            N Offline
            Nick_3141592654
            wrote on last edited by
            #5

            Sorry Richard, no you're right! Intended for the original questioner - my mistake.

            1 Reply Last reply
            0
            • M MadDoc79

              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!

              N Offline
              N Offline
              Nick_3141592654
              wrote on last edited by
              #6

              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!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups