I’m working with Android framework for custom ROM.
For a reason I need to send an Object to another application by reference, not by cloning the data. don’t want AIDL or intent because they need to copy the data through Parcelable or Json.
Like this:
App1
void func1(TextView t)
{
App2.func2(t);
}
App2
void func2(TextView t)
{
String s=t.toString();
}
guess sending a reference is possible because I heard there is no concept of process in JVM, so no boundary of processes. Is it possible? if not, can it be done under the JNI with C++ shared memory?
Android has it’s own virtual machine called Dalvik and on the contrary of JVM, Dalvik runs different applications in different instances of DalvikVM (processes). Thus, in Android there are several IPC mechanisms (Binder is one of them).
In your case, you need to use Ashmem. It’s a kind of shared memory but specially for Android. I have only theoretical knowledge in this sphere, never tried it for my own.
Here is an article how to create shared memory region.