Out of Memory error on older Android devices
QAID # 21619 Published
Question / Problem:
I am running an Android app that implements the Kofax Mobile SDK. When I take a picture on an older device, such as a Samsung S3, an out of memory error occurs.
Answer / Solution:
The cameras in current mobile devices have the ability to take very high resolution images. This along with the image processing drivers implemented with the SDK can require quite a bit of RAM in the device.
Applications running on API Level 11+ can have android:largeHeap="true"
in the <application>
element in the manifest to request a larger-than-normal heap size, and getLargeMemoryClass()
on ActivityManager will tell you how big that heap is.
In the Kofax Mobile Demo sample app, there is an example of how to set this parameter in the AndroidManifest.xml
file.
In the application
section, note the setting:
android:largeHeap="true"
Applies to:
Product | Version |
---|---|
MOBILESDK | 2.4 |
2.5 | |
2.6 |