Client-Server: File transfer from Android to PC connected via socket

后端 未结 3 368
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 00:54

I\'m trying to send a picture I choose from the gallery on my phone, and send that picture from the phone to my PC, when I click on the button it should take the picture\'s

相关标签:
3条回答
  • 2020-12-05 01:33

    Instead of trying it in emulator on PC try to run the same on a mobile device. Also I have changed the Port number to 8000 instead of using 1149 port.

    With these changes the code worked fine for me. Please check.

    0 讨论(0)
  • 2020-12-05 01:35

    you have just to add the permission

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    

    and it will work perfect.

    0 讨论(0)
  • 2020-12-05 01:54

    It aint working cos u havn't reintialized your variable current to 0 It seems your are apending in the subsequent loop without reseting the value. So in my guess it might be causing problem in the second iteration of your execution.

    0 讨论(0)
提交回复
热议问题