I have such a requirement. In Android native service process, we will do something and post data to java layer in a constant speed, i.e 30 per second. In App layer, we have to receive these data and do the according operations. The native service and App are in two different processes, and we should do as quickly as possible.
I know binder may solve my problem, but implementation is heavy. Is there any quick and simple IPC mechanism that can meet my requirement? Better have sample code. Thanks.
I have a quick solution by utilize Android Property mechanism.
In native service, I set a property:
char value[PROPERTY_VALUE_MAX];
memset(value, 0, sizeof(value));
sprintf(value, "%d:%d:%d:%d", x, y, width, height);
property_set("mstar.media.face", value);
In java app, I get this property
String sFace = SystemProperties.get("mstar.media.face", "");
This may not be the best solution, but it can meet my requirement. I will search for better solution later.