# Package com.codename1.nearby.transport

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.

- Related Packages
  Package
  Description
  com.codename1.nearby
  Nearby devices: how far away one is, which one is yours, and how to send it something.
  com.codename1.nearby.companion
  Companion-device association: telling the operating system which accessory is yours, and getting privileges back for it.
  com.codename1.nearby.ranging
  Ultra-wideband precision ranging: how far away another device is, and in which direction.
  com.codename1.nearby.spi
  The service-provider interface each port implements to carry `com.codename1.nearby` onto the platform's short-range stacks.
- Class
  Description
  Endpoint
  Another device seen advertising the same service id.
  IncomingConnection
  An incoming request from another device that wants to connect, delivered to `TransportListener.connectionRequested(IncomingConnection)`.
  NearbyTransport
  Moving bytes and files to a device that is physically nearby, with no access point, no pairing and no internet.
  Payload
  Something to send to a connected endpoint: either a block of bytes or a file.
  PayloadStatus
  Where a payload transfer got to, carried by `PayloadTransferUpdate`.
  PayloadTransferUpdate
  Progress on one payload, delivered to `TransportListener.payloadProgress(Endpoint, PayloadTransferUpdate)`.
  TransportAdapter
  A `TransportListener` whose methods all do nothing, so a caller interested in two events overrides two methods.
  TransportListener
  Receives everything the nearby transport has to say.
  TransportStrategy
  The connection topology a transport session uses.