iink SDK on Device

Answered

Is there any way to reduce memory usage

I read the demo code which is for Android devices, and the demo need to create four layers to work: BACKGROUND, MODEL, TEMPORARY and CAPTURE.

For each layer, we need to create a bitmap configured in ARGB_8888. This means on a phone with 1080*1920 resolution, it will cost about 1080*1920*4*4 bytes (about 31.6 MB) memory.

In my case, I need to put the custom recognition View ( just like EditorView ) in a ViewPager, and this cause memory consumption increase to 31.6 * 3 M (about 94M).

So for this situation, I need to ask what can be done to reduce memory usage.

Can I use RGB_565 for BACKGROUND bitmap or are all the four layers necessary?

Thanks and best wishes.


Best Answer

Dear Chengkong,


thank you for your question, which raised interest on our side.


Currently, indeed you are right about the figures. You might try to set RGB 565 for the background, but as the other 3 layers are mandatory with transparency information, they should be kept in ARGB_8888.


As you guess, this is not likely to gain much memory usage.


Best regards,


Olivier



1 Comment

Answer

Dear Chengkong,


thank you for your question, which raised interest on our side.


Currently, indeed you are right about the figures. You might try to set RGB 565 for the background, but as the other 3 layers are mandatory with transparency information, they should be kept in ARGB_8888.


As you guess, this is not likely to gain much memory usage.


Best regards,


Olivier