{"id":1446,"date":"2016-03-07T16:31:03","date_gmt":"2016-03-07T08:31:03","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1446"},"modified":"2026-08-18T12:58:49","modified_gmt":"2026-08-18T04:58:49","slug":"android%e6%b6%88%e6%81%af%e6%8e%a8%e9%80%81%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1446","title":{"rendered":"Android\u6d88\u606f\u63a8\u9001\u89e3\u51b3\u65b9\u6848"},"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;\">\u8fdb\u9910\u9986\u8fd8\u6ca1\u6253\u5f00 App\uff0c\u624b\u673a\u5c31\u5f39\u51fa\u6253\u6298\u6d88\u606f\u2014\u2014\u5750\u6807\u65e9\u5c31\u5728\u5e93\u91cc\uff0c\u670d\u52a1\u7aef\u5339\u914d\u540e\u518d <strong>Push<\/strong> \u4e0b\u6765\u3002\u95ee\u9898\u4e0d\u5728 GPS\uff0c\u800c\u5728\u670d\u52a1\u7aef\u600e\u4e48\u628a\u6d88\u606f\u5b9e\u65f6\u9001\u5230\u5ba2\u6237\u7aef\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\u3001\u6d88\u606f\u63a8\u9001\u57fa\u7840<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u6d88\u606f\u63a8\u9001\uff0c\u662f\u5728\u7f51\u4e0a\u5b9a\u671f\u628a\u7528\u6237\u9700\u8981\u7684\u4fe1\u606f\u9001\u8fc7\u53bb\uff0c\u51cf\u5c11\u4fe1\u606f\u8fc7\u8f7d\u3002\u5b83\u6309\u5174\u8da3\u641c\u7d22\u3001\u8fc7\u6ee4\uff0c\u518d\u5b9a\u671f\u63a8\u7ed9\u7528\u6237\u3002\u79fb\u52a8\u5e94\u7528\u8ddf\u670d\u52a1\u5668\u4ea4\u4e92\u65f6\uff0c\u65e2\u8981\u4e0a\u4f20\uff0c\u4e5f\u8981\u4ece\u670d\u52a1\u5668\u62ff\u6570\u636e\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u4e00\u822c\u60c5\u51b5\u4e0b\u5ba2\u6237\u7aef\u662f\u4e3b\u52a8\u65b9\u3002\u670d\u52a1\u5668\u6570\u636e\u66f4\u65b0\u4e86\u3001\u8981\u4e0b\u53d1\u901a\u77e5\uff0c\u53ea\u80fd\u7b49\u5ba2\u6237\u7aef\u4e0b\u6b21\u8fde\u4e0a\u2014\u2014\u6d88\u606f\u5c31\u4e22\u4e86\u5b9e\u65f6\u6027\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u8981\u8ba9\u5ba2\u6237\u7aef\u5b9e\u65f6\u6536\u5230\u901a\u77e5\uff0c\u5927\u4f53\u4e24\u6761\u8def\uff1a<\/p>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section><strong>Pull\uff08\u62c9\uff09<\/strong>\uff1a\u9694\u4e00\u6bb5\u65f6\u95f4\u53bb\u670d\u52a1\u5668\u95ee\u6709\u6ca1\u6709\u66f4\u65b0\u3002<\/section>\n<\/li>\n<li>\n<section><strong>Push\uff08\u63a8\uff09<\/strong>\uff1a\u670d\u52a1\u5668\u6709\u65b0\u4fe1\u606f\u5c31\u63a8\u5230\u5ba2\u6237\u7aef\uff0c\u5ba2\u6237\u7aef\u81ea\u52a8\u6536\u5230\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px;\">\u90fd\u80fd\u62ff\u5230\u66f4\u65b0\uff0c\u4f46 Push \u66f4\u5408\u9002\uff1aPull \u66f4\u8d39\u6d41\u91cf\u548c\u7535\uff0c\u8fd8\u5f97\u7a0b\u5e8f\u4e0d\u505c\u76ef\u7740\u670d\u52a1\u7aef\u3002<\/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\u3001\u51e0\u79cd\u5e38\u89c1\u65b9\u6848<\/span><\/h2>\n<h3 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em;\">1. \u8f6e\u8be2\uff08Pull\uff09<\/h3>\n<p style=\"margin: 1em 0px;\">\u5ba2\u6237\u7aef\u5b9a\u65f6\u5411\u670d\u52a1\u5668\u53d1\u8be2\u95ee\uff0c\u670d\u52a1\u5668\u6709\u53d8\u5316\u5c31\u7acb\u523b\u540c\u6b65\u3002\u5b9e\u73b0\u7b80\u5355\uff0c\u8d39\u7535\u8d39\u6d41\u91cf\u3002<\/p>\n<h3 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em;\">2. SMS\uff08Pull\uff09<\/h3>\n<p style=\"margin: 1em 0px;\">\u62e6\u622a\u77ed\u4fe1\u5e76\u89e3\u6790\u5185\u5bb9\uff0c\u5f53\u4f5c\u670d\u52a1\u5668\u547d\u4ee4\u3002\u4e00\u65e6\u6709\u53d8\u5316\u5c31\u540c\u6b65\u3002\u7528\u6237\u7ecf\u6d4e\u4e0a\u5f88\u96be\u627f\u53d7\uff0c\u8fd8\u8981\u77ed\u4fe1\u5e73\u53f0\u914d\u5408\u3002<\/p>\n<h3 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em;\">3. \u6301\u4e45\u8fde\u63a5\uff08Push\uff09<\/h3>\n<p style=\"margin: 1em 0px;\">\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u5efa\u957f\u8fde\u63a5\uff0c\u6d88\u606f\u53ca\u65f6\u3001\u5b9e\u65f6\uff1b\u7f3a\u70b9\u662f\u8fde\u63a5\u4e0d\u7a33\u5b9a\u3002<\/p>\n<h3 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em;\">4. C2DM \u4e91\u7aef\u63a8\u9001<\/h3>\n<p style=\"margin: 1em 0px;\">Google \u63d0\u4f9b C2DM\uff08Cloud to Device Messaging\uff09\uff0c\u5e2e\u5f00\u53d1\u8005\u4ece\u670d\u52a1\u5668\u5411 Android \u5e94\u7528\u53d1\u6570\u636e\u3002\u673a\u5236\u8f7b\u91cf\uff1a\u670d\u52a1\u5668\u901a\u77e5\u5e94\u7528\u53bb\u8ddf\u670d\u52a1\u5668\u901a\u4fe1\uff0c\u62ff\u66f4\u65b0\u548c\u7528\u6237\u6570\u636e\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u4e3b\u8981\u95ee\u9898\u662f\u5fc5\u987b\u4f9d\u8d56 Google \u5b98\u65b9 C2DM \u670d\u52a1\u5668\uff0c\u56fd\u5185\u7f51\u7edc\u4e0b\u7ecf\u5e38\u4e0d\u53ef\u7528\u3002<\/p>\n<h3 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em;\">5. XMPP \u5b9e\u73b0 Android \u63a8\u9001<\/h3>\n<p style=\"margin: 1em 0px;\">\u5b98\u65b9 C2DM \u5e95\u5c42\u4e5f\u662f XMPP\u3002XMPP\uff08\u53ef\u6269\u5c55\u901a\u8baf\u548c\u8868\u793a\u534f\u8bae\uff09\u57fa\u4e8e XML\uff0c\u7528\u4e8e\u5373\u65f6\u6d88\u606f\u548c\u5728\u7ebf\u63a2\u6d4b\u3002<\/p>\n<p style=\"margin: 1em 0px;\">androidpn \u662f\u57fa\u4e8e XMPP \u7684 Java \u5f00\u6e90 Android push \u5b9e\u73b0\uff0c\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u90fd\u6709\u3002\u4e0d\u8db3\u4e5f\u5f88\u660e\u663e\uff1a<\/p>\n<ol style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: decimal;\">\n<li>\n<section>\u65f6\u95f4\u8fc7\u957f\u5c31\u518d\u4e5f\u6536\u4e0d\u5230\u63a8\u9001\u3002<\/section>\n<\/li>\n<li>\n<section>\u6027\u80fd\u4e0d\u591f\u7a33\u5b9a\u3002<\/section>\n<\/li>\n<li>\n<section>\u6d88\u606f\u4ece\u670d\u52a1\u5668\u63a8\u51fa\u53bb\u5c31\u4e0d\u518d\u7ba1\uff0c\u4e0d\u7ba1\u6709\u6ca1\u6709\u5230\u624b\u673a\u4e0a\u3002<\/section>\n<\/li>\n<\/ol>\n<p style=\"margin: 1em 0px;\">\u8981\u7528 androidpn\uff0c\u8fd8\u5f97\u7406\u89e3 XMPP\u3001\u7406\u89e3\u5b83\u7684\u5b9e\u73b0\uff0c\u518d\u8c03\u5185\u90e8 BUG\u3002<\/p>\n<h3 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em;\">6. \u7b2c\u4e09\u65b9\u5e73\u53f0<\/h3>\n<p style=\"margin: 1em 0px;\">\u56fd\u5185\u5916\u90fd\u6709\u63a8\u9001\u5e73\u53f0\uff0c\u4f46\u6536\u8d39\u3001\u4fdd\u5bc6\u3001\u670d\u52a1\u8d28\u91cf\u3001\u6269\u5c55\u7b49\u95ee\u9898\uff0c\u53c8\u8ba9\u4eba\u5374\u6b65\u3002\u767e\u5ea6\u4e91\u63a8\u9001\u53ef\u53c2\u8003\uff1a<a href=\"http:\/\/blog.csdn.net\/lmj623565791\/article\/details\/27231237\">Android\u63a8\u9001 \u767e\u5ea6\u4e91\u63a8\u9001 \u5165\u95e8\u7bc7<\/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;\">\u65b9\u6848<\/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;\">\u7c7b\u578b<\/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;\">\u8981\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;\">\u8f6e\u8be2<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Pull<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5b9a\u65f6\u95ee\u670d\u52a1\u5668\uff0c\u8d39\u7535\u8d39\u6d41\u91cf<\/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;\">SMS<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Pull<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u62e6\u622a\u77ed\u4fe1\u5f53\u547d\u4ee4\uff0c\u6210\u672c\u9ad8<\/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;\">\u6301\u4e45\u8fde\u63a5<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Push<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5b9e\u65f6\uff0c\u4f46\u8fde\u63a5\u4e0d\u7a33<\/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;\">C2DM<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Push<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u4f9d\u8d56 Google\uff0c\u56fd\u5185\u5e38\u4e0d\u53ef\u7528<\/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;\">XMPP \/ androidpn<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Push<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5f00\u6e90\u5b8c\u6574\uff0c\u8d85\u65f6\u3001\u7a33\u5b9a\u3001\u9001\u8fbe\u90fd\u8981\u81ea\u5df1\u8865<\/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;\">\u7b2c\u4e09\u65b9\u5e73\u53f0<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Push<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u7701\u4e8b\uff0c\u8981\u6743\u8861\u6536\u8d39\u3001\u4fdd\u5bc6\u3001\u6269\u5c55<\/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\u5b9e\u65f6\u901a\u77e5\u9760 Push \u800c\u4e0d\u662f\u8f6e\u8be2\uff1b\u56fd\u5185\u522b\u8d4c C2DM\uff0c\u957f\u8fde\u63a5\u3001XMPP \u6216\u7b2c\u4e09\u65b9\u5e73\u53f0\u90fd\u8981\u5148\u628a\u7a33\u5b9a\u6027\u548c\u9001\u8fbe\u8865\u9f50\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u8fdb\u9910\u9986\u8fd8\u6ca1\u6253\u5f00 App\uff0c\u624b\u673a\u5c31\u5f39\u51fa\u6253\u6298\u6d88\u606f\u2014\u2014\u5750\u6807\u65e9\u5c31\u5728\u5e93\u91cc\uff0c\u670d\u52a1\u7aef\u5339\u914d\u540e\u518d Push \u4e0b\u6765\u3002\u95ee\u9898\u4e0d\u5728 GPS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[45],"tags":[80],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1446"}],"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=1446"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1446\/revisions"}],"predecessor-version":[{"id":1449,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1446\/revisions\/1449"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}