Class AssetsExtractor

java.lang.Object
com.vivoka.vsdk.util.AssetsExtractor

public class AssetsExtractor extends Object
Utility class for extracting static assets from the APK at runtime.
  • Constructor Details

    • AssetsExtractor

      public AssetsExtractor()
  • Method Details

    • extract

      public static void extract(android.content.Context context, String assetsPath, String dstPath) throws Exception
      ⚠️ [Test-Only] Avoid using this method in production.

      This method extracts static assets (such as media, configuration files, or large datasets) to the device's file system from within the APK at runtime. Those assets must be bundled inside the APK or App Bundle, which increases the overall size of your app.

      Recommended: Host the data on a server (e.g., Firebase, S3, CDN) and download only needed ones. This approach:

      • Keeps the APK lightweight
      • Supports dynamic content updates without requiring a full app update
      • Reduces storage footprint on user devices
      Parameters:
      context - The context must remain valid until the end of the extraction.
      assetsPath - The path to the assets inside the APK.
      dstPath - The destination path on the device's file system.
      Throws:
      Exception - If there is an error extracting the assets.
    • extract

      public static void extract(android.content.Context context, String assetsPath, String dstPath, boolean logDetails) throws Exception
      ⚠️ [Test-Only] Avoid using this method in production.

      This method extracts static assets (such as media, configuration files, or large datasets) to the device's file system from within the APK at runtime. Those assets must be bundled inside the APK or App Bundle, which increases the overall size of your app.

      Recommended: Host the data on a server (e.g., Firebase, S3, CDN) and download only needed ones. This approach:

      • Keeps the APK lightweight
      • Supports dynamic content updates without requiring a full app update
      • Reduces storage footprint on user devices
      Parameters:
      context - The context must remain valid until the end of the extraction.
      assetsPath - The path to the assets inside the APK.
      dstPath - The destination path on the device's file system.
      logDetails - Whether to log details about the extraction process.
      Throws:
      Exception - If there is an error extracting the assets.