I'm writing an asynchronous image downloader for Android and was just wondering, given an arbitary URL such as:
http://www.android.com/images/brand/droid.gif
What would be the best way to convert the unique url to a filename. I thought about simply splitting the url and grabbing the last section, but I want the filename to be representative of the whole URL. The other alternatives I thought were replacing all the forward slashes with underscores or simply hashing the whole URL and storing this.
If anyone has any ideas I'd love to hear them!
Thanks
The filename is the last part of the URL from the last trailing slash. For example, if the URL is http://www.example.com/dir/file.html then file. html is the file name.
In case, usually uses MD5 hash. but I suggest to use 'aquery' library. In library you can simply download Image asynchronous and put it to view. It also support disk cache, memory cache simply.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With