0

As I am a newbie, I don't know how to google to solve this question.

Then I ask this question.

Now, I have a list in an Html show in the WebView in the App. like this:

enter image description here

You can see an image located in the left area in an item of the list.

Is there a way to store the list image.

How to store the image Use the javascript?

or

How to store the image by using the iOS webView API?

How to store the image by using the Android webView API?

What I need:

In a week or several days, the app requests the same network image once. Now, my app requests the image every time. This way waste user's mobile phone traffic.

If you don't know my expression. I know a perfect library named SDWebImage. In iOS APP, the SDWebImage can store the image in a week.

jiexishede
  • 2,473
  • 6
  • 38
  • 54

1 Answers1

0

If you are loading it using WebView, you should consider caching the WebPage. You can enable the cache for WebView using this property:

https://developer.android.com/reference/android/webkit/WebSettings.html#LOAD_CACHE_ELSE_NETWORK

mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

Else if you are using URL's to load the image into custom ListView or RecyclerView, this library could help you out:

https://github.com/nostra13/Android-Universal-Image-Loader

DEVV911
  • 448
  • 1
  • 5
  • 9