Hello, I have to develop android application that is used for screen sharing of android device through wifip2p(NFC) technology
so i am thinking of doing it by capturing screenshot from source device and send it to the destination device but in screen sharing frames per second plays an important role and that does not work. so please suggest me any other solution of if this than how can i achieve it efficiently.

Dani AI

Generated

Building on 's wifi‑p2p hint and 's note that bitmap screenshots kill FPS: avoid sending full-screen PNG/JPEG images. For interactive screen sharing the practical and modern approach is a real‑time video pipeline — capture the display, hardware‑encode it, stream encoded frames, then decode and render on the receiver. On Android this is best done with MediaProjection (screen capture) + MediaCodec (hardware H.264/HEVC encoder) and a low‑latency transport (direct sockets/RTP or WebRTC) rather than repeated bitmap transfers.

A compact pipeline and tuning tips:

  • Capture: start MediaProjection (requires user consent; API 21+). See the platform guide for details: .
  • Encode: feed the projection into a hardware encoder surface (MediaCodec.createInputSurface()), avoid reading pixels to Java memory. See MediaCodec docs: MediaCodec reference.
  • Transport: for local wifi‑p2p a raw UDP/RTP stream can be lowest latency; for easier congestion/jitter control and security use WebRTC: WebRTC official site.
  • Decode/render: on receiver use MediaCodec decoder and render to a SurfaceView/TextureView.
  • Tune: reduce resolution, lower bitrate, shorten I‑frame interval for interactivity, and prefer hardware codecs to avoid CPU copies.

Practical alternatives and cautions:

  • If you control both apps, sending UI/state/commands instead of pixels yields the lowest bandwidth/latency.
  • VNC/delta approaches work for mostly static screens but struggle with video/animations.
  • Look at existing projects for implementation patterns (example desktop/mobile reference: scrcpy; older Android streaming libs: libstreaming).
  • Watch battery, thermal throttling, and per‑device encoder limits. Measure end‑to‑end latency and tune resolution/bitrate into a sweet spot for each device.

Have you seen this?

I'm not sure if this will help you out, but it is a place to start. :)

Ya i have done this i have already worked upon it but now i am stuck that which method should i use to send thw view of one android device to another

Okay, I just I would send you that in case you hadn't seen it.

Good luck! :)

ohk thank you so much but if u have any idea of my further question then please tell me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.