Git Product home page Git Product logo

ndk-socket-ipc's Introduction

NDK-Socket-IPC

This this a experiment to see different forms of IPC (inter-process communication) for native apps not exposed to the Android Binder SDK class. The current 3 forms are Unix Domain Sockets, NDK Shared Memory, and NDK AHardwareBuffer. This app has a server app that is one of 4 colors and a client app that changes the color. My blog post with more details

Pure Unix Domain demo (generates full screen color on server end)
AHardwareBuffer demo (server reads data generated from client saved in shared memory buffer)

Disclaimer: The code was a quick prototype, for a friend as a proof of concept. Also have not profiled and not sure if there is better way of doing IPC in native Android app, if so please share since a Google search shows very little on topic

The 3 Methods

  1. Unix Domain Sockets
  • Good o'l C style Unix Domain Sockets
    • Same idea if ever sent TCP/UDP Sockets before
  • Works for any version of Android
  1. Shared Memory
  1. AHardwareBuffer

How to run

  • Each folder has a Client and Server folder each containing an Android Studio project.
  • Open both and install on device.
  • Open server app first (currently working on more robust example)
  • Open client app and pick color
  • Either switch back to server app to see change of color or open LogCat and view the print out

ndk-socket-ipc's People

Contributors

sjfricke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.