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. General Programming
  3. C#
  4. Access Android Tablet from C#

Access Android Tablet from C#

Scheduled Pinned Locked Moved C#
jsoncsharpandroidmobilecom
8 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.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I'm trying to write an app that allowed me to copy data from an Android app to a C# app via USB. I will probably write the data to a json file and copy the file to my C# app, either by sending it from Android or copying it from C#. [I found this api](https://forum.xda-developers.com/t/dev-androidlib-net-android-device-communication-and-management-library-01-20-13.1512685/) but it looks old and I can't find any documentation. Does anyone know how I can send or copy a file from Android app to a C# app via USB?

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    L OriginalGriffO 2 Replies Last reply
    0
    • K Kevin Marois

      I'm trying to write an app that allowed me to copy data from an Android app to a C# app via USB. I will probably write the data to a json file and copy the file to my C# app, either by sending it from Android or copying it from C#. [I found this api](https://forum.xda-developers.com/t/dev-androidlib-net-android-device-communication-and-management-library-01-20-13.1512685/) but it looks old and I can't find any documentation. Does anyone know how I can send or copy a file from Android app to a C# app via USB?

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

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

      If you connect the Android device to a PC via USB then it should appear as a new disk drive. A quick test with your device should confirm that and you can then see whether you can access the files.

      K 1 Reply Last reply
      0
      • K Kevin Marois

        I'm trying to write an app that allowed me to copy data from an Android app to a C# app via USB. I will probably write the data to a json file and copy the file to my C# app, either by sending it from Android or copying it from C#. [I found this api](https://forum.xda-developers.com/t/dev-androidlib-net-android-device-communication-and-management-library-01-20-13.1512685/) but it looks old and I can't find any documentation. Does anyone know how I can send or copy a file from Android app to a C# app via USB?

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        Richard is right, but ... it may depend on how the Android device is configured . There are two ways Android can connect to a PC - MTP for media transfer (pictures and videos), or UMS (for files): Android USB Connections Explained: MTP, PTP, and USB Mass Storage[^] If the device is selected to "Charge only" or MTP, you won't see the device as a file source.

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        K 2 Replies Last reply
        0
        • L Lost User

          If you connect the Android device to a PC via USB then it should appear as a new disk drive. A quick test with your device should confirm that and you can then see whether you can access the files.

          K Offline
          K Offline
          Kevin Marois
          wrote on last edited by
          #4

          I thought so too, but it doesn't show up. And I have Developer Mode and USB Debugging turned on

          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

          L 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            Richard is right, but ... it may depend on how the Android device is configured . There are two ways Android can connect to a PC - MTP for media transfer (pictures and videos), or UMS (for files): Android USB Connections Explained: MTP, PTP, and USB Mass Storage[^] If the device is selected to "Charge only" or MTP, you won't see the device as a file source.

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

            K Offline
            K Offline
            Kevin Marois
            wrote on last edited by
            #5

            Thanks. I'll look into it

            If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

            1 Reply Last reply
            0
            • K Kevin Marois

              I thought so too, but it doesn't show up. And I have Developer Mode and USB Debugging turned on

              If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

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

              That has always worked for me, but see also @OriginalGriff's comments below.

              1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                Richard is right, but ... it may depend on how the Android device is configured . There are two ways Android can connect to a PC - MTP for media transfer (pictures and videos), or UMS (for files): Android USB Connections Explained: MTP, PTP, and USB Mass Storage[^] If the device is selected to "Charge only" or MTP, you won't see the device as a file source.

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                K Offline
                K Offline
                Kevin Marois
                wrote on last edited by
                #7

                I got it now. I went into Settings => USB Preferences and selected "File Transfer". Now I can see the tablet and all the folders under it. Thanks for pointing me in the right direction.

                If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                OriginalGriffO 1 Reply Last reply
                0
                • K Kevin Marois

                  I got it now. I went into Settings => USB Preferences and selected "File Transfer". Now I can see the tablet and all the folders under it. Thanks for pointing me in the right direction.

                  If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                  OriginalGriffO Offline
                  OriginalGriffO Offline
                  OriginalGriff
                  wrote on last edited by
                  #8

                  You're welcome!

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                  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