{"id":4442,"date":"2023-05-08T12:06:06","date_gmt":"2023-05-08T04:06:06","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=4442"},"modified":"2023-05-08T12:06:06","modified_gmt":"2023-05-08T04:06:06","slug":"android%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6%e5%b8%b8%e8%a7%81%e7%9a%84%e6%9c%89%e9%82%a3%e4%ba%9b","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appshangjia\/4442.html","title":{"rendered":"android\u5f00\u53d1\u6846\u67b6\u5e38\u89c1\u7684\u6709\u90a3\u4e9b?"},"content":{"rendered":"<p>Android\u5f00\u53d1\u6846\u67b6\u662f\u6307\u4e00\u5957\u5305\u542b\u4e86\u57fa\u7840\u7ec4\u4ef6\u3001\u5f00\u53d1\u5de5\u5177\u3001API\u7b49\u7684\u8f6f\u4ef6\u67b6\u6784\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u6784\u5efaAndroid\u5e94\u7528\u3002Android\u5f00\u53d1\u6846\u67b6\u5206\u4e3a\u4e24\u79cd\uff0c\u4e00\u79cd\u662f\u539f\u751f\u7684Android\u6846\u67b6\uff0c\u53e6\u4e00\u79cd\u662f\u7b2c\u4e09\u65b9\u6846\u67b6\u3002<\/p>\n<p>1. \u539f\u751f\u7684Android\u6846\u67b6<\/p>\n<p>\u539f\u751f\u7684Android\u6846\u67b6\u662f\u6307\u7531Google\u5b98\u65b9\u63d0\u4f9b\u7684Android\u64cd\u4f5c\u7cfb\u7edf\u81ea\u5e26\u7684\u6846\u67b6\u3002\u5b83\u5305\u542b\u4e86\u56db\u4e2a\u6838\u5fc3\u7ec4\u4ef6\uff1aActivity\u3001Service\u3001Broadcast Receiver\u548cContent Provider\u3002<\/p>\n<p>Activity\u662fAndroid\u5e94\u7528\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u7ec4\u4ef6\uff0c\u5b83\u8d1f\u8d23\u5c55\u793a\u7528\u6237\u754c\u9762\uff0c\u63a5\u6536\u7528\u6237\u8f93\u5165\u548c\u5904\u7406\u5e94\u7528\u903b\u8f91\u3002\u4e00\u4e2a\u5e94\u7528\u53ef\u4ee5\u5305\u542b\u591a\u4e2aActivity\uff0c\u6bcf\u4e2aActivity\u90fd\u6709\u4e00\u4e2a\u751f\u547d\u5468\u671f\uff0c\u5305\u62ec\u521b\u5efa\u3001\u542f\u52a8\u3001\u6682\u505c\u3001\u6062\u590d\u3001\u505c\u6b62\u548c\u9500\u6bc1\u7b49\u9636\u6bb5\u3002\u901a\u8fc7Activity\u4e4b\u95f4\u7684\u5207\u6362\uff0c\u5b9e\u73b0\u4e0d\u540c\u754c\u9762\u4e4b\u95f4\u7684\u4ea4\u4e92\u3002<\/p>\n<p>Service\u662fAndroid\u5e94\u7528\u4e2d\u7684\u540e\u53f0\u670d\u52a1\u7ec4\u4ef6\uff0c\u5b83\u53ef\u4ee5\u5728\u540e\u53f0\u6267\u884c\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u4efb\u52a1\uff0c\u5982\u4e0b\u8f7d\u6587\u4ef6\u3001\u64ad\u653e\u97f3\u4e50\u7b49\u3002Service\u53ef\u4ee5\u5728\u5e94\u7528\u8fdb\u7a0b\u5916\u5355\u72ec\u8fd0\u884c\uff0c\u5e76\u4e14\u53ef\u4ee5\u4e0e\u5176\u4ed6\u5e94\u7528\u7ec4\u4ef6\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n<p>Broadcast Receiver\u662fAndroid\u5e94\u7528\u4e2d\u7684\u5e7f\u64ad\u63a5\u6536\u5668\u7ec4\u4ef6\uff0c\u5b83\u53ef\u4ee5\u63a5\u6536\u7cfb\u7edf\u6216\u5176\u4ed6\u5e94\u7528\u53d1\u9001\u7684\u5e7f\u64ad\u6d88\u606f\u3002\u5e7f\u64ad\u6d88\u606f\u53ef\u4ee5\u662f\u7cfb\u7edf\u4e8b\u4ef6\uff0c\u5982\u7535\u6c60\u72b6\u6001\u3001\u7f51\u7edc\u72b6\u6001\u7b49\uff0c\u4e5f\u53ef\u4ee5\u662f\u5e94\u7528\u81ea\u5b9a\u4e49\u7684\u6d88\u606f\u3002\u901a\u8fc7\u5e7f<a href=\"https:\/\/www.yimenapp.net\/dabao-3269.html\">ipa\u8f6f\u4ef6\u5728\u54ea\u91cc\u4e0b<\/a>\u64ad\u6d88\u606f\uff0c\u4e0d\u540c\u5e94\u7528\u4e4b\u95f4\u53ef\u4ee5\u8fdb\u884c\u901a\u4fe1\u548c\u6570\u636e\u4ea4\u6362\u3002<\/p>\n<p>Content Provider\u662fAndroid\u5e94\u7528\u4e2d\u7684\u6570\u636e\u5b58\u50a8\u7ec4\u4ef6\uff0c\u5b83\u53ef\u4ee5\u63d0\u4f9b\u5e94\u7528\u5185\u548c\u5e94\u7528\u95f4\u7684\u6570\u636e\u5171\u4eab\u3002\u901a\u8fc7Content Pro<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/31\/15\/17507816517.jpg\" \/><\/figure>\n<\/p>\n<p>vider\uff0c\u5e94\u7528\u53ef\u4ee5\u5c06\u6570\u636e\u5b58\u50a8\u5728Android\u7cfb\u7edf\u4e2d\uff0c\u5176\u4ed6\u5e94\u7528\u53ef\u4ee5\u901a\u8fc7Content Provider\u8bbf\u95ee\u8fd9\u4e9b\u6570\u636e<a href=\"https:\/\/www.yimenapp.net\/dabao-855.html\">\u5b89\u5353\u5b89\u88c5\u5305 \u82f9\u679c<\/a>\u3002<\/p>\n<p>\u9664\u4e86\u56db\u4e2a\u6838\u5fc3\u7ec4\u4ef6\u4e4b\u5916\uff0cAndroid\u6846\u67b6\u8fd8\u5305\u542b\u4e86\u5176\u4ed6\u4e00\u4e9b\u91cd\u8981\u7ec4\u4ef6\uff0c\u5982Fragment\u3001View\u3001Intent\u3001Layout\u7b49\u3002\u8fd9\u4e9b\u7ec4\u4ef6\u90fd\u662f\u6784\u5efaAndroid\u5e94\u7528\u7684\u57fa\u7840\u3002<\/p>\n<p>2. \u7b2c\u4e09\u65b9\u6846\u67b6<\/p>\n<p>\u9664\u4e86\u539f\u751f\u7684Android\u6846\u67b6\u4e4b\u5916\uff0c\u8fd8\u6709\u5f88\u591a\u7b2c\u4e09\u65b9\u6846\u67b6\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u5feb\u901f\u3001\u66f4\u9ad8\u6548\u5730\u6784\u5efaAndroid\u5e94\u7528\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u7b2c\u4e09\u65b9\u6846\u67b6\uff1a<\/p>\n<p>\uff081\uff09OkHttp<\/p>\n<p>OkHttp\u662f\u4e00\u4e2aHTTP\u5ba2\u6237\u7aef\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5e94\u7528\u53d1\u9001HTTP\u8bf7\u6c42\u548c\u63a5\u6536HTTP\u54cd\u5e94\u3002OkHttp\u5177\u6709\u9ad8\u6548\u3001\u53ef\u9760\u3001\u6613\u7528\u7b49\u7279\u70b9\uff0c\u53ef\u4ee5\u5927\u5927\u7b80\u5316\u7f51\u7edc\u8bf7\u6c42\u7684\u4ee3\u7801\u3002<\/p>\n<p>\uff082\uff09Retrofit<\/p>\n<p>Retrofit\u662f\u4e00\u4e2aRESTful API\u5ba2\u6237\u7aef\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5e94\u7528\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u901a\u4fe1\u3002Retrofit\u53ef\u4ee5\u5c06API\u63a5\u53e3\u8f6c\u6362\u4e3aJava\u63a5\u53e3\uff0c\u4f7f\u5f97\u5e94\u7528\u53ef\u4ee5\u50cf\u8c03\u7528\u672c\u5730\u65b9\u6cd5\u4e00\u6837\u8c03\u7528\u8fdc\u7a0bAPI\u3002<\/p>\n<p>\uff083\uff09Glide<\/p>\n<p>Glide\u662f\u4e00\u4e2a\u56fe\u7247\u52a0\u8f7d\u5e93\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5e94\u7528\u52a0\u8f7d\u548c\u663e\u793a\u56fe\u7247\u3002Glide\u5177\u6709\u9ad8\u6548\u3001\u6613\u7528\u3001\u53ef\u914d\u7f6e\u7b49\u7279\u70b9\uff0c\u53ef\u4ee5\u5927\u5927\u7b80\u5316\u56fe\u7247\u52a0\u8f7d\u7684\u4ee3\u7801\u3002<\/p>\n<p>\uff084\uff09ButterKnife<\/p>\n<p>ButterKnife\u662f\u4e00\u4e2aView\u6ce8\u5165\u5e93\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5e94\u7528\u7ed1\u5b9aView\u548c\u4e8b\u4ef6\u5904\u7406\u65b9\u6cd5\u3002\u901a\u8fc7ButterKnife\uff0c\u5e94\u7528\u53ef\u4ee5\u7701\u53bbfindViewById\u548csetOnClickListener\u7b49\u7e41\u7410\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u603b\u4e4b\uff0cAndroid\u5f00\u53d1\u6846\u67b6\u662f\u6784\u5efaAndroid\u5e94\u7528\u7684\u57fa\u7840\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u5feb\u901f\u3001\u66f4\u9ad8\u6548\u5730\u6784\u5efa\u5e94\u7528\u3002\u9664\u4e86\u539f\u751f\u7684Android\u6846\u67b6\u4e4b\u5916\uff0c\u8fd8\u6709\u5f88\u591a\u4f18\u79c0\u7684\u7b2c\u4e09\u65b9\u6846\u67b6\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u5b8c\u6210\u5e94\u7528\u5f00\u53d1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android\u5f00\u53d1\u6846\u67b6\u662f\u6307\u4e00\u5957\u5305\u542b\u4e86\u57fa\u7840\u7ec4\u4ef6\u3001\u5f00\u53d1\u5de5\u5177\u3001API\u7b49\u7684\u8f6f\u4ef6\u67b6\u6784\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u6784\u5efaAndroid\u5e94\u7528\u3002Android\u5f00\u53d1\u6846\u67b6\u5206\u4e3a\u4e24\u79cd\uff0c\u4e00\u79cd\u662f\u539f\u751f\u7684Android\u6846\u67b6\uff0c\u53e6\u4e00\u79cd\u662f\u7b2c\u4e09\u65b9<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[5914,2185,5897,2763,2892],"class_list":["post-4442","post","type-post","status-publish","format-standard","hentry","category-appshangjia","tag-android","tag-2185","tag-apk","tag-2763","tag-2892"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/4442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=4442"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/4442\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=4442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=4442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=4442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}