Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

What is Play Feature Delivery

You want to partition your Android app into a part that includes the Anyline SDK (on-demand module) and a part that doesn’t (base App)?

Play Feature Delivery (PFD, also known as Dynamic Feature Delivery) allows certain features of your app to be delivered conditionally or downloaded on demand.

This means, the 120MB the Anyline SDK needs will only be downloaded by a user who specifically requests the Anyline Scanning functionality.

What’s the issue?

Separating the Anyline SDK out into an on-demand module works, but upon actually running the functionality a problem occurs because two factors collide:

  • Play Feature Delivery has a known limitation: It isn't possible to use Android WebView in an activity that accesses resources or assets from an optional module.

  • The Anyline SDK uses WebView with local resources in several cases (examples are the Visual Feedback implementation and the WaterMarkImage).

In other words: Because the Anyline SDK implementation uses what is a known limitation with Play Feature Delivery, problems occur.

Side note: Additionally to the issue described above, when using PFD there’s a crash with the Anyline dependency MLKit, which can be solved by the integrator with this Stackoverflow answer.

The workaround, including the limitations

Until Anyline fixes this issue on SDK-side a workaround for the aforementioned limitation consists of a combination of three measures:

  1. The customer needs to be using a license without watermark. (Why: a license with WaterMark accesses local assets with WebView, which leads to a crash)

  2. The customer is fine with losing the “Live Preview” (i.e. the blue overlayed rectangles drawn over recognized characters). In this case the integrator needs to switch their viewConfig.json element viewPlugin->cutoutConfig->style from “rect” to “animated_rect”.
    Additional changes to the viewConfig.json might be necessary, such as adapting viewPlugin->cutoutConfig->maxWidthPercent: “90%” and viewPlugin->cutoutConfig->maxHeightPercent: “90%”. (Why: style “rect” uses WebView with local assets; style “animated_rect” uses native implementation)

  3. The integrator fixes the MLKit Crash with their implementation (relevant Stackoverflow answer)

  • No labels