Share memory between two processes in Dalvik
<p>I have created an android service which exposes an interface to the applications to accept a camera frame byte array. The service uses a native library to process this camera frame and returns some data about the camera frame. The goal is to be able to process camera preview frames in real time. </p>

<p><strong>Problem</strong> - My AIDL file has an API called initFrame(in byte[] frame). Whenever I call this API from an application(running in a separate process), I get an exception - <a href="http://developer.android.com/reference/android/os/TransactionTooLargeException.html." rel="nofollow">TransactionTooLargeException</a> </p>

<p>This is because the size of the byte array is > 1MB and the binder transaction buffer has a limited fixed size of 1MB. Even if the size limit was bigger, it is very inefficient to copy large buffers for real time processing. </p>

<p><strong>Question</strong> - Is there a way in android to share memory between two dalvik processes which can help solve the problem? I looked at <a href="http://developer.android.com/reference/android/os/MemoryFile.html" rel="nofollow">MemoryFile</a> but it seems MemoryFile can only be used to share memory between processes using hidden APIs at this point.</p>
