We work on rooted tablet and execute in the background a pure C++ native process. This process is a service that communicates with USB device and grab video images from it.
We also have an Android application which communicates with this process through JNI. It acquires video images from the device and displays them on screen.
We have some problems in this architecture that we have not found a solution yet:
1. We get strange freezes every few seconds (like every 10 seconds or so), it looks like the threads are getting starved. We have logs that show the processing stages, and every 10 seconds or so we see logs that indicate that threads miss a few frames.
This means the threads were frozen for about 100-200 ms.
I haveve tried changing the application nice level with renice. But it didn't seem to help
2. We would like to execute this process as a system service (like in Linux). This process should be executed when the table is started and should start working when any client application tries to communicate with our device.
3. Ways to improve UI performance
4. The most effective ways to store a large amount of frames coming with a high frequency
5. The most memory and performance wise way to create , present and dispose a large amount of objects (or, more specifically, Bitmaps)