none
Peer to Peer connection to sharing the file. RRS feed

  • Question

  • Hi

    I need to make peer to peer connection to share the files. We have an applications which developed for windows 10 [UWP app] and same for Android app. So I need to share files for below-

    1. Share with in UWP app in windows 10.

    2. Share with UWP to Android app or Android to UWP.

    I need to use http protocol to make the connection with in UWP or UWP-Android.

    Thanks

    Sandeep


    sandeep chauhan

    Tuesday, July 9, 2019 10:42 AM

Answers

  • Hi,

    Yes, basically that's it.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 15, 2019 5:23 AM
    Moderator

All replies

  • You'd have to use HttpLitener

    https://docs.microsoft.com/en-us/dotnet/api/system.net.httplistener?view=netframework-4.8

    And HttpRequest, or HttpClient.

    You make the HttpListener listen on a port (it cannot be 80 sadly), and you ca send streams with the 2 classes to its IP address and port.

    If you develop your app with Xamarin, you can use the same classes on both Android and UWP. These classes are available on UWP 16299 and newer. On older versions you'd have to build the http protocol on top of StreamSocketListener and StreamSocket.


    Tuesday, July 9, 2019 1:52 PM
  • Hi,

    Does @mcosmin's reply make sense?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, July 10, 2019 9:52 AM
    Moderator
  • Hi Mcosmin

    Thanks for reply!

    My UWP app minimum version supports till Anniversary Update 14393.

    And Android app is made as native app (JAVA) not developed in xamarine. 

     "On older versions you'd have to build the http protocol on top of StreamSocketListener and StreamSocket."

    Is this StreamSocketListner and StreamSocket will support for android code? How Android developers will receive the file if I send file using this from UWP.


    sandeep chauhan

    Thursday, July 11, 2019 2:29 PM
  • Hi,

    Android has it's own APIs to listen for HttpRequest. This is out of the scope of UWP forum.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, July 12, 2019 2:27 AM
    Moderator
  • Hi Roy/Mcosmin

    Thanks for help.

    So should I go ahead with  StreamSocketListener and StreamSocket class in UWP, I would be needed only android device's IP address to make connection with android device, right ?

    And Android developers have own api to receive my request, right ?

    and when Android will try to make connection with UWP via using UWP device's IP, I will receive request it using  StreamSocketListener and StreamSocket class.

    Please let me know if I am wrong at any point.

    Thanks

    Sandeep


    sandeep chauhan

    Friday, July 12, 2019 5:36 AM
  • Hi,

    Yes, basically that's it.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 15, 2019 5:23 AM
    Moderator