In our app we have html pages which are loaded into webview from the asset directory. These in turn load jpg images from the same place. I need to move the jpg's to an expansion file due to the 50mg app size limitation of Google Play. We don't want to move the html pages, for security reasons. Can anyone tell me how to load a jpg from an expansion file into the html webpage?
Thanks
Christine
A few more thoughts:
This link posts a similar question but remains unanswered:
Using images from apk expansion file in android webview
This link does have answers but they seem incomplete, at least for my needs:
How we can use images from APK main expansion file?
I am thinking that the URI interface to the expansion file (APEZProvider creates a ContentProvider for the ExpansionFile, see http://developer.android.com/guide/google/play/expansion-files.html#ZipLib) might be the way to go but I am unclear how to get the information to the Javascript. Currently we are using:
I've tried overriding ShouldInterceptRequest, as suggested in webview shouldinterceptrequest example,
expecting to get a callback when the image is about to be loaded, so that I could then modify the url, but shouldInterceptRequest doesn't get called.
So, does anybody have any ideas how to intercept the loading of the jpg and re-direct the url to the one obtained from the Expansion File's ContentProvider?
Any other suggestions short of unzipping the expansion file? Any help would be much appreciated. I've spent a few days researching this now
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…