Package com.codename1.nearby.transport
Sending bytes and files to a device in the same room, with no access point, no pairing and no internet.
Start at NearbyTransport.
Read the limitation before designing around this
This transport does not cross ecosystems. It is Google's Nearby Connections on Android and Apple's MultipeerConnectivity on iOS, and the two share no wire protocol, so an Android phone and an iPhone will never discover each other here no matter how the app is written. The API does not hide that, because an API that looked portable and silently never found the peer would be worse.
When both ends of the conversation are not the same platform, the
framework already has two options that do work across the divide:
com.codename1.bluetooth.le.L2capChannel for a raw byte stream over BLE,
and com.codename1.io.bonjour plus sockets when both devices share a
Wi-Fi network.
-
ClassDescriptionAnother device seen advertising the same service id.An incoming request from another device that wants to connect, delivered to
TransportListener.connectionRequested(IncomingConnection).Moving bytes and files to a device that is physically nearby, with no access point, no pairing and no internet.Something to send to a connected endpoint: either a block of bytes or a file.Where a payload transfer got to, carried byPayloadTransferUpdate.Progress on one payload, delivered toTransportListener.payloadProgress(Endpoint, PayloadTransferUpdate).ATransportListenerwhose methods all do nothing, so a caller interested in two events overrides two methods.Receives everything the nearby transport has to say.The connection topology a transport session uses.