This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/open-a-document/from-in-memory-data.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Open PDF from in-memory data on Android | Nutrient SDK

Prefer random-access storage, usually a file, for PDF data. Keeping PDFs only in memory has two disadvantages:

  • Memory limits — Large PDFs or devices with limited memory can cause OutOfMemoryError.
  • Process recreation — An in-memory provider loses data across process recreations(opens in a new tab). Android can terminate your process when all app activities run in the background. When the app returns to the foreground, Android recreates the process without the provider’s data.

Nutrient removed MemoryDataProvider in Android SDK 3.1.1 because of these limitations. Use another data provider class that matches your data source.