android icon indicating copy to clipboard operation
android copied to clipboard

Allow receiving data from PC

Open ShortDevelopment opened this issue 3 years ago • 9 comments

Custom implementation of the cdp protocol (transport layer).

  • [x] #11
  • [x] Listen via rfcomm (1b694db9df0fec43b8c62fd78587f0fe9478bb37)
  • [x] Connect (public keys)
  • [x] #12
  • [x] #13
  • [x] Auth (device / user certificat)
  • [x] Device Info
  • [x] CdpChannel
  • [ ] ReliabilityResponse
  • [ ] Reliable connections

Custom implementation of NearShare protocol (application layer)

  • [x] ~#15~
  • [x] Bond schema (ValueSet)
  • [x] #14
  • [x] Uri Message
  • [x] File Transfer (single file)
  • [ ] Reliable transfer (big files)
  • [ ] File Transfer (multiple file)

UI / UX / Android

  • [x] BT mac address settings (7cd910979ab8e9969f36d4b44301860689d77eca)
  • [x] Acceptance
  • [ ] Save file
  • [ ] Polish

ShortDevelopment avatar Aug 06 '22 11:08 ShortDevelopment

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cdp/

ShortDevelopment avatar Aug 06 '22 11:08 ShortDevelopment

Just wanna say thank you! Amazing piece of software... Looking forward to the receive functionality :)

fm-sys avatar Sep 16 '22 14:09 fm-sys

For the receive functionality, do you have a schedule?

jethoujun avatar Oct 31 '22 08:10 jethoujun

@jethoujun Sadly no.

There are several reasons:

  • I’m doing this (alone) in my free time
  • The documentation is not really complete
  • I completely have to reverse engeneer the NearShare protocol sitting on to of the (genericly documented) cdp protocol (not so difficult but…)
  • Alongside the bond serialization schema used for NearShare (komplex)

Therefore, I can neither really estimate how much time I’m gone have nor how much work remains.

That said, I'll try to publish an early alpha version this month (Nov 2022) (no promises).

ShortDevelopment avatar Oct 31 '22 11:10 ShortDevelopment

That said, I'll try to publish an early alpha version this month (Nov 2022) (no promises).

I can't believe you even have the possibility of getting this to work! I thought it was impossible to send data from Windows back to Android like that.

@ShortDevelopment I hope you know anyone in the Windows or Google dev teams working on the full implementation that was announced last January.

"Do more with Android and Windows PCs. For the first time with Android, we’re also focused on building for other platforms, like Windows, whether it's in gaming, productivity or other areas. For example, by connecting your Android phone to your Windows PC with Fast Pair, you’ll be able to quickly set up Bluetooth accessories, sync text messages and share files with Nearby Share. We’re working with Acer, HP and Intel to bring these experiences to select Windows PCs first later this year." https://blog.google/products/android/ces2022-bettertogether/#:~:text=Do%20more%20with,later%20this%20year.

Microsoft doubles down on its Android + Windows efforts in latest reorg last updated April 01, 2022 A new 'Microsoft Android' division houses Duo, SwiftKey, Launcher, and more.

"Nearby Share is the other bigger feature shared between Android and Chrome OS. It will come to Windows PCs from Acer and HP, along with Fast Pair for Bluetooth, this year. Google is actively seeking to do reverse of Microsoft by offering more cross-service integrations to Windows, like Android games on desktop." https://9to5google.com/2022/04/01/microsoft-android/#:~:text=Nearby%20Share%20is,on%20desktop.

Google is bringing Nearby Share and Fast Pair to Windows PCs https://9to5google.com/2022/01/05/google-nearby-share-android-windows/

nearby_share_windows

vonDubenshire avatar Nov 13 '22 19:11 vonDubenshire

@vonDubenshire Nope, I’m just doing this on my own and I sadly don’t have any contacts to any (related) Microsoft / Google staff…

ShortDevelopment avatar Nov 13 '22 20:11 ShortDevelopment

@vonDubenshire Note that both Microsoft and Google calls their own wireless data sharing protocol Nearby Share (see Google, Microsoft), but these are two different and incompatible protocols, just like AirDrop is. Google engineers are working to bring their protocol to Windows (see google/nearby). I'm not sure if Microsoft wants to bring Google's protocol to Windows or their protocol to Android, but in either case I wouldn't count on them until they announce it officially.

tiborbaksa avatar Nov 13 '22 22:11 tiborbaksa

I think Microsoft has a BIG advantage to bring a general protocol for cross-platform file sharing, but they are not working on it with great efforts. Hope new updates from MS!

jethoujun avatar Nov 15 '22 07:11 jethoujun

It actually seems like microsoft is still actively working on nearby sharing as they’ve recently released a new protocol version (actually only minor changes).
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cdp/f5a15c56-ac3a-48f9-8c51-07b2eadbe9b4

They don’t seem to work on their public library any more though...

ShortDevelopment avatar Nov 21 '22 13:11 ShortDevelopment

@jethoujun

I know it took some time, but I’m happy to announce that a first alpha version is available right now. Join the “Beta”-Program on google play: https://nearshare.shortdev.de/#receive-data

This version should be capable of receiving urls and (very) small files (one at a time). It would be great if you all could grab this version and test it a little bit.

Feedback: https://forms.office.com/r/j2Fp5biXKB

As I’m doing this on my own with little to no time (right now) it might still take some time to get a (somewhat) stable release…

ShortDevelopment avatar Nov 30 '22 09:11 ShortDevelopment

I'm getting a crash when trying to start the beta app:

[ERROR] FATAL UNHANDLED EXCEPTION: System.PlatformNotSupportedException: Arg_PlatformNotSupported
at System.Text.ASCIIUtility.GetIndexOfFirstNonAsciiByte_Intrinsified(Byte* , UIntPtr )
at System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte(Byte* , Int32 , Int32& , Int32& )
at System.Text.UTF8Encoding.GetCharCount(Byte* , Int32 )
at System.String.CreateStringFromEncoding(Byte* , Int32 , Encoding )
at System.Text.Encoding.GetString(Byte* , Int32 )
at System.String.CreateStringForSByteConstructor(Byte* , Int32 )
at System.String.Ctor(SByte* value)
at System.Runtime.InteropServices.Marshal.PtrToStringAnsi(IntPtr )
at Java.Interop.TypeManager.GetClassName(IntPtr )
at Android.Runtime.JNIEnv.RegisterJniNatives(IntPtr , Int32 , IntPtr , IntPtr , Int32 )

fm-sys avatar Nov 30 '22 23:11 fm-sys

@fm-sys

Are you on v1.2.1-alpha (newest beta in store)? What device with what OS version did you test on?

ShortDevelopment avatar Nov 30 '22 23:11 ShortDevelopment

Ah, thanks for the hint. I was still on v1.2.0-alpha

fm-sys avatar Nov 30 '22 23:11 fm-sys

But good to know!!

I did not have the time to check why the app crashed on newer android versions. It seems to be a known bug with AOT compilation...

ShortDevelopment avatar Nov 30 '22 23:11 ShortDevelopment

Here's an early Christmas present! 🎄 A new, improved version is currently rolling out in the public test track on Google Play! 🎉

Changelog

  • Transfer acknowledgement (windows side)
  • Large transfers keep alive
  • Fast transfer while in same network (Tcp)

Don’t forget to give feedback!

  • New Issue
  • Forms: https://forms.office.com/r/j2Fp5biXKB

ShortDevelopment avatar Dec 16 '22 22:12 ShortDevelopment

This supposedly „simple“ feature turned out to be a huge effort! But now that a general receiving functionality is working, we’re finished here!

What happens next

  • This stuff will stay in the testing track in Play Store for a little longer until I can ensure that it has proven to be mostly stable and secure.
  • Replace the microsoft library used for sending with custom implementation
  • New platforms!
  • Please open new issues for further bugs / requests!

Don’t forget to join the brand new Discord Server!

ShortDevelopment avatar Jan 09 '23 23:01 ShortDevelopment