{"id":1071,"date":"2015-12-22T21:10:48","date_gmt":"2015-12-22T13:10:48","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1071"},"modified":"2026-08-18T12:58:45","modified_gmt":"2026-08-18T04:58:45","slug":"android%e5%bc%82%e6%ad%a5%e5%9b%be%e7%89%87%e5%8a%a0%e8%bd%bd%e5%ba%93","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1071","title":{"rendered":"Android\u5f02\u6b65\u56fe\u7247\u52a0\u8f7d\u5e93"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\">\u5f02\u6b65\u52a0\u8f7d\u3001\u7f13\u5b58\u3001\u663e\u793a\u7f51\u7edc\u56fe\uff0c\u4e0d\u5fc5\u6bcf\u6b21\u4ece\u96f6\u5199\u3002\u4e0b\u9762\u5bf9\u6bd4 <strong>Universal-Image-Loader<\/strong>\u3001<strong>Picasso<\/strong>\u3001<strong>Android-ImageCache-Warmtel<\/strong>\u3001<strong>Glide<\/strong> \u548c <strong>Fresco<\/strong>\uff0c\u65b9\u4fbf\u6309\u9879\u76ee\u9009\u578b\u3002<\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e00\u3001Android-Universal-Image-Loader<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u5f00\u6e90 UI \u7ec4\u4ef6\uff0c\u76ee\u6807\u662f\u53ef\u590d\u7528\u7684\u5f02\u6b65\u56fe\u7247\u52a0\u8f7d\u3001\u7f13\u5b58\u548c\u663e\u793a\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/12\/20151222213145.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1077\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/12\/20151222213145.png\" alt=\"20151222213145\" width=\"542\" height=\"357\" srcset=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/12\/20151222213145.png 542w, https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/12\/20151222213145-528x348.png 528w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u7279\u70b9\uff1a<\/p>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section>\u591a\u7ebf\u7a0b\u56fe\u7247\u52a0\u8f7d<\/section>\n<\/li>\n<li>\n<section>\u5f02\u6b65\u52a0\u8f7d\u7f13\u5b58\uff1a\u5185\u5b58\uff08\u8f6f\u5f15\u7528\uff09+ \u672c\u5730<\/section>\n<\/li>\n<li>\n<section>\u53ef\u914d\u7f6e\u7ebf\u7a0b\u6c60\u3001HTTP\u3001\u5185\u5b58\/\u78c1\u76d8\u7f13\u5b58\u3001\u663e\u793a\u9009\u9879\u7b49<\/section>\n<\/li>\n<li>\n<section>\u52a0\u8f7d\u8fc7\u7a0b\u53ef\u76d1\u542c\u548c\u4e8b\u4ef6\u5904\u7406<\/section>\n<\/li>\n<li>\n<section>\u5706\u89d2\u3001\u52a0\u8f7d\u5b8c\u6210\u52a8\u753b\u7b49\u663e\u793a\u9009\u9879<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\">\u7528\u6cd5\uff1a<a href=\"http:\/\/hao.jobbole.com\/android-universal-image-loader\/\" target=\"_blank\">Android-Universal-Image-Loader: \u53ef\u91cd\u590d\u4f7f\u7528\u7684\u4eea\u5668\u4e3a\u5f02\u6b65\u56fe\u7247\u52a0\u8f7d\uff0c\u7f13\u5b58\u548c\u663e\u793a<\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u5f00\u6e90\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/nostra13\/Android-Universal-Image-Loader\" target=\"_blank\" rel=\"nofollow\">https:\/\/github.com\/nostra13\/Android-Universal-Image-Loader<\/a><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e8c\u3001Picasso<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">Square \u5f00\u6e90\u7684\u56fe\u5f62\u7f13\u5b58\u5e93\uff0c\u5730\u5740 <a id=\"url_1\" href=\"http:\/\/square.github.io\/picasso\/\" target=\"_blank\">http:\/\/square.github.io\/picasso\/<\/a>\uff0c\u8d1f\u8d23\u4e0b\u8f7d\u548c\u7f13\u5b58\u3002\u7528\u6cd5\u5f88\u77ed\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">Picasso.with(context).load(\"http:\/\/i.imgur.com\/DvpvklR.png\").into(imageView);<\/code><\/pre>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section>Adapter \u91cc\u56de\u6536\u5e76\u53d6\u6d88\u5f53\u524d\u4e0b\u8f7d<\/section>\n<\/li>\n<li>\n<section>\u7528\u5c3d\u91cf\u5c11\u7684\u5185\u5b58\u505a\u590d\u6742\u53d8\u6362<\/section>\n<\/li>\n<li>\n<section>\u81ea\u52a8\u5185\u5b58 + \u786c\u76d8\u7f13\u5b58<\/section>\n<\/li>\n<li>\n<section>\u7f29\u653e\u3001\u65cb\u8f6c\u7b49\u53d8\u6362\uff0c\u4e5f\u53ef\u81ea\u5b9a\u4e49<\/section>\n<\/li>\n<li>\n<section>\u7f51\u7edc\u6216\u672c\u5730\u8d44\u6e90\u90fd\u80fd\u52a0\u8f7d<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\">\u7528\u6cd5\uff1a<a href=\"http:\/\/blog.csdn.net\/xu_fu\/article\/details\/17043231\">Android\u56fe\u7247\u4e0b\u8f7d\u7f13\u5b58\u5e93picasso\u89e3\u6790<\/a><\/p>\n<p style=\"margin: 1em 0px;\">gitHub\u5730\u5740:<a href=\"https:\/\/github.com\/square\/picasso\">https:\/\/github.com\/square\/picasso<\/a><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e09\u3001Android-ImageCache-Warmtel<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u6781\u7b80\u5355\u7684\u7f51\u7edc\u56fe\u7247\u5f02\u6b65\u52a0\u8f7d\u5e93\uff0c\u53ea\u6709\u4e00\u4e2a\u5b9e\u73b0\u7c7b\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">AsyncMemoryFileCacheImageLoader.getInstance(context).loadBitmap(getResources(), picUrl, imageView);<\/code><\/pre>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section>\u5f02\u6b65\u7f51\u7edc\u52a0\u8f7d\u56fe\u7247<\/section>\n<\/li>\n<li>\n<section>LruCache \u5185\u5b58\u7f13\u5b58<\/section>\n<\/li>\n<li>\n<section>DiskLruCache \u6587\u4ef6\u7f13\u5b58<\/section>\n<\/li>\n<li>\n<section>\u591a\u4efb\u52a1\u540c\u6b65\u6267\u884c<\/section>\n<\/li>\n<li>\n<section>\u9ad8\u6548\u5927\u56fe\u5904\u7406<\/section>\n<\/li>\n<li>\n<section>ListView \/ GridView \u6eda\u52a8\u9519\u4e71\u5904\u7406<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/github.com\/yihu0817\/Android-ImageCache-Wamtel\">\u6e90\u7801Demo\u4e0b\u8f7d<\/a><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u56db\u3001Glide \u4e0e Fresco<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u6cf0\u56fd\u8c37\u6b4c\u5f00\u53d1\u8005\u8bba\u575b\u4e0a\u4ecb\u7ecd\u7684 <a href=\"https:\/\/github.com\/bumptech\/glide\" target=\"_blank\">Glide<\/a>\uff08\u4f5c\u8005 bumptech\uff09\uff0c\u5927\u91cf\u7528\u5728 Google \u5f00\u6e90\u9879\u76ee\u91cc\uff0c\u5305\u62ec 2014 \u5e74 I\/O \u5b98\u65b9 App\u3002\u548c Picasso \u7ea6 90% \u76f8\u4f3c\uff0c\u7ec6\u8282\u4e0d\u540c\uff1a\u652f\u6301 Gif\u3001\u7f29\u7565\u56fe\u3001\u672c\u5730\u89c6\u9891\u89e3\u7801\u3001\u8bf7\u6c42\u4e0e\u52a8\u753b\u751f\u547d\u5468\u671f\u3001\u6e10\u663e\u3001OkHttp \/ Volley\uff1b\u9ed8\u8ba4 HttpUrlConnection\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5bfc\u5165\u5e93\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">dependencies {\n    compile 'com.github.bumptech.glide:glide:3.5.2'\n    compile 'com.android.support:support-v4:22.0.0'\n}<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/blog.csdn.net\/fancylovejava\/article\/details\/44747759\">\u8be6\u7ec6\u5206\u6790<\/a>\u3000github\u5730\u5740:<a href=\"https:\/\/github.com\/bumptech\/glide\">https:\/\/github.com\/bumptech\/glide<\/a><\/p>\n<p style=\"margin: 1em 0px;\">Fresco \u5185\u90e8\u5927\u91cf\u5efa\u9020\u8005\u3001\u5355\u4f8b\u3001\u9759\u6001\u5de5\u5382\u3001\u751f\u4ea7\/\u6d88\u8d39\u8005\u3002\u52a0\u8f7d\u8def\u5f84\u5927\u81f4\u662f\uff1a\u5f02\u6b65\u62ff\u8f93\u5165\u6d41 \u2192 \u8bfb\u5199\u8f6c\u6210 EncodedImage \u2192 Decode \u6210 Bitmap \u2192 Handler \u56de UI \u2192 IO \u5199\u5165\u786c\u76d8\u7f13\u5b58\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/blog.csdn.net\/u010687392\/article\/details\/50266633\">\u8be6\u7ec6\u5206\u6790<\/a>\u3000<a href=\"http:\/\/frescolib.org\/docs\/requesting-multiple-images.html#_\">Fresco\u5b98\u65b9\u6587\u6863<\/a><\/p>\n<table style=\"border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; text-align: left; overflow: auto; display: table; overflow-wrap: break-word; word-break: break-all;\" width=\"817\">\n<thead>\n<tr>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u5e93<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u7279\u70b9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">UIL<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u53ef\u914d\u7f6e\u7ebf\u7a0b\u6c60\u3001\u53cc\u7f13\u5b58\u3001\u663e\u793a\u9009\u9879\u4e0e\u76d1\u542c<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Picasso<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u4e00\u884c API\uff0cAdapter \u53d6\u6d88\u4e0b\u8f7d\uff0c\u5185\u5b58\/\u78c1\u76d8\u7f13\u5b58<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Warmtel<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5355\u7c7b\u5c01\u88c5 Lru + DiskLru\uff0c\u5904\u7406\u5217\u8868\u9519\u4e71<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Glide<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u63a5\u8fd1 Picasso\uff0c\u53e6\u6709 Gif\u3001\u751f\u547d\u5468\u671f\u3001\u7f29\u7565\u56fe<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Fresco<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u6d41\u6c34\u7ebf\u590d\u6742\uff0cEncodedImage \u2192 Bitmap \u2192 \u78c1\u76d8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\"><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u8981\u4e00\u884c API \u7528 Picasso \/ Glide\uff1b\u8981\u53ef\u914d\u7f6e\u9009 UIL\uff1b\u8981\u6781\u7b80\u53cc\u7f13\u5b58\u770b Warmtel\uff1b\u8981\u5b8c\u6574\u6d41\u6c34\u7ebf\u518d\u4e0a Fresco\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u5f02\u6b65\u52a0\u8f7d\u3001\u7f13\u5b58\u3001\u663e\u793a\u7f51\u7edc\u56fe\uff0c\u4e0d\u5fc5\u6bcf\u6b21\u4ece\u96f6\u5199\u3002\u4e0b\u9762\u5bf9\u6bd4 Universal-Image-Loader\u3001Picas [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[66,202],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1071"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1071"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1071\/revisions"}],"predecessor-version":[{"id":1131,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1071\/revisions\/1131"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}