{"id":10006242,"date":"2022-08-18T11:23:48","date_gmt":"2022-08-18T03:23:48","guid":{"rendered":"https:\/\/ityet.com\/?p=10006242"},"modified":"2022-08-18T11:23:48","modified_gmt":"2022-08-18T03:23:48","slug":"%e5%ba%94%e7%94%a8%e7%bc%ba%e5%b0%91poi%e6%95%b0%e6%8d%ae%ef%bc%8c%e5%a6%82%e4%bd%95%e5%bc%80%e5%8f%91%e5%9c%b0%e7%82%b9%e6%b7%b1%e5%ba%a6%e4%bf%a1%e6%81%af%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006242","title":{"rendered":"\u5e94\u7528\u7f3a\u5c11POI\u6570\u636e\uff0c\u5982\u4f55\u5f00\u53d1\u5730\u70b9\u6df1\u5ea6\u4fe1\u606f\uff1f"},"content":{"rendered":"<p>\u7528\u6237\u5728App\u91cc\u641c\u7d22\u67d0\u4e2a\u5730\u70b9\u65f6\uff0c\u5e76\u4e0d\u6ee1\u8db3\u5355\u4e00\u7684\u5730\u70b9\u4fe1\u606f\uff0c\u5e0c\u671b\u5f97\u5230\u66f4\u591a\u53ef\u4ee5\u5e2e\u52a9\u5176\u505a\u51b3\u7b56\u7684\u6df1\u5ea6\u4fe1\u606f\u3002\u4f8b\u5982\u6709\u6253\u8f66\u51fa\u884c\u9700\u6c42\u7684\u7528\u6237\uff0c\u5728\u6253\u8f66App\u91cc\u641c\u7d22\u5730\u70b9\u65f6\u53ef\u4ee5\u663e\u793a\u5468\u8fb9\u7684\u5730\u70b9\uff0c\u7cbe\u786e\u5230\u67d0\u4e2a\u8def\u53e3\uff0c\u8ba9\u7528\u6237\u53ef\u4ee5\u81ea\u7531\u9009\u62e9\u5408\u9002\u7684\u4e0a\u4e0b\u8f66\u70b9\u3002\u94f6\u884c\u91d1\u878dApp\u7c7b\u53ef\u4ee5\u8ba9\u7528\u6237\u5728\u641c\u7d22\u65f6\u663e\u793a\u9644\u8fd1\u7ebf\u4e0b\u7f51\u70b9\u548c\u8425\u4e1a\u65f6\u95f4\u3001\u7535\u8bdd\u4ee5\u53ca\u5468\u8fb9\u9053\u8def\u4fe1\u606f\u7b49\u3002<\/p>\n<p>\u4e0d\u8fc7\u5728App\u91cc\u5f00\u53d1\u641c\u7d22\u5730\u70b9\u7684\u76f8\u5173\u4fe1\u606f\u529f\u80fd\u9700\u8981\u5927\u91cf\u7684\u5730\u70b9\u6570\u636e\u7b49\u4fe1\u606f\uff0c\u9762\u5bf9\u6570\u636e\u4e0d\u591f\u7684\u60c5\u51b5\uff0c\u600e\u4e48\u624d\u80fd\u5f00\u53d1\u63d0\u4f9b\u7528\u6237\u5728\u67e5\u770b\u4e0d\u540c\u7c7b\u578b\u7684\u5730\u70b9\uff08\u5982\u9152\u5e97\u3001\u9910\u996e\u3001\u666f\u70b9\uff09\u65f6\uff0c\u53ef\u4ee5\u83b7\u53d6\u5230\u6709\u9488\u5bf9\u6027\u7684\u6df1\u5ea6\u4fe1\u606f\uff08\u5982\u8425\u4e1a\u65f6\u95f4\u3001\u8bc4\u5206\u7b49\uff09\u7684\u80fd\u529b\u5462\uff1f<\/p>\n<p>HMS Core<a href=\"https:\/\/link.segmentfault.com\/?enc=vAYVRNxoGUIgcZrCipUocA%3D%3D.PnMJnrOw2SznB0GLjxUwxFZvGVXu2pF%2By1cjEKtgKhcXlyWrcu3IBSlFx0N9ddsQqEyh3y6rUlv0kG%2BX0j8nlJQVy7uuR9naJOv7q2SEmyo%3D\" rel=\"nofollow\">\u4f4d\u7f6e\u670d\u52a1<\/a>\u63d0\u4f9b\u4e00\u7ad9\u5f0f\u641c\u7d22\u670d\u52a1\uff0c\u62e5\u67092.6\uff0b\u4ebf\u5168\u7403POI\u6570\u636e\uff0c\u8986\u76d6200+\u56fd\u5bb6\u4e0e\u5730\u533a\uff0c\u652f\u6301\u5168\u740370\uff0b\u79cd\u8bed\u8a00\u3002\u5176\u4e2d<a href=\"https:\/\/link.segmentfault.com\/?enc=wb7esaPdGZ9etzWegmvugg%3D%3D.G5e5CfPQwLsS7jJIPrWF3qvlNySptTiKSVGHpd%2FvMJBnXfTfr%2FdLBVY8Sl%2FF6wOamE5QEUsKam%2BBWM9RLIxMKAg2IcZ2RMLruVkHnIxrw3IAipwv4xMUw8CURMP5TRBMse0T20ievaqh5KgNz1MWuizaIjwKjIcErlhybi58LQ2o0cz2d6Heyp1rS7EwA0gt\" rel=\"nofollow\">\u5730\u70b9\u8be6\u60c5\u529f\u80fd<\/a>\u53ef\u4ee5\u6839\u636e\u5730\u70b9\u7684\u552f\u4e00\u4e3b\u952e\u5730\u70b9ID\u83b7\u53d6\u5730\u70b9\u8be6\u60c5\uff0c\u5730\u70b9\u8be6\u7ec6\u4fe1\u606f\u8bf7\u6c42\u8fd4\u56de\u6709\u5173\u6307\u5b9a\u5730\u70b9\u7684\u66f4\u5168\u9762\u7684\u4fe1\u606f\uff0c \u5982\u5730\u70b9\u540d\u79f0\u3001\u5730\u5740\u8be6\u7ec6\u4fe1\u606f\u3001\u7ecf\u7eac\u5ea6\u7b49\u3002\u6bd4\u5982\u7528\u6237\u6253\u5f00\u7269\u6d41\u7c7bApp\u53ef\u4ee5\u641c\u7d22\u5230\u9644\u8fd1\u7f51\u70b9\u3001\u8425\u4e1a\u65f6\u95f4\u3001\u7535\u8bdd\u7b49\uff1b\u65c5\u884c\u7c7bApp\u63d0\u4f9b\u641c\u7d22\u666f\u70b9\u5177\u4f53\u7684\u4f4d\u7f6e\u3001\u9644\u8fd1\u7684\u9152\u5e97\u3001\u5929\u6c14\u7b49\uff1bLBS\u7c7b\u6e38\u620f\u4e5f\u53ef\u4ee5\u57fa\u4e8e\u5730\u70b9\u8be6\u60c5\u529f\u80fd\u505a\u76f8\u5173\u6539\u7f16\uff0c\u5728\u6e38\u620f\u5185\u641c\u7d22\u67d0\u5730\u70b9\u65f6\u53ef\u4ee5\u67e5\u770b\u8be5\u5730\u70b9\u7684\u4efb\u52a1\u3001\u73a9\u5bb6\u3001\u533a\u57df\u6392\u540d\u7b49\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042337577\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h3>Demo\u6f14\u793a<\/h3>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042337578\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h3>\u5f00\u53d1\u6b65\u9aa4<\/h3>\n<h4>1.    \u5f00\u53d1\u51c6\u5907<\/h4>\n<p>1.1    \u914d\u7f6e<a href=\"https:\/\/link.segmentfault.com\/?enc=WBFjXz0u3gEUHu%2Bl6zJZSw%3D%3D.0FRPqvdoTgrsG7wU45aZ6SshwEeEJPMfSSDzelgVNlTLbB90RcryqgFq7RA2HCYONJTp%2By%2B6M%2FzXj1o%2FfrFuIMH5wQeQcarkOvgMFXEJa3QBo61lieDmbFMOoEk1OIAI\" rel=\"nofollow\">AppGallery Connect<\/a><\/p>\n<p>\u5728\u5f00\u53d1\u5e94\u7528\u524d\uff0c\u9700\u8981\u5728AppGallery Connect\u4e2d\u914d\u7f6e\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n<p>1.2    \u96c6\u6210HMS Core SDK<\/p>\n<p>\u9488\u5bf9Android Studio\u5f00\u53d1\u73af\u5883\uff0c\u534e\u4e3a\u63d0\u4f9b\u4e86Maven\u4ed3\u96c6\u6210\u65b9\u5f0f\u7684HMS Core SDK\u5305\u3002\u5728\u5f00\u59cb\u5f00\u53d1\u524d\uff0c\u60a8\u9700\u8981\u5c06HMS Core SDK\u96c6\u6210\u5230\u60a8\u7684Android Studio\u5f00\u53d1\u73af\u5883\u4e2d\u3002<\/p>\n<p>1.3    \u914d\u7f6e\u6df7\u6dc6\u811a\u672c<\/p>\n<p>\u7f16\u8bd1APK\u524d\u9700\u8981\u914d\u7f6e\u6df7\u6dc6\u914d\u7f6e\u6587\u4ef6\uff0c\u907f\u514d\u6df7\u6dc6HMS Core SDK\u5bfc\u81f4\u529f\u80fd\u5f02\u5e38\u3002<\/p>\n<p>\u8be6\u7ec6\u51c6\u5907\u6b65\u9aa4\u53ef\u53c2\u8003<a href=\"https:\/\/link.segmentfault.com\/?enc=jVjT1SnYZBg8Ebf9FoQ5pw%3D%3D.uQN%2FnAgf2db4U0IshPTpIvMg7QhNev%2F99eUc4dQ9nvueDxDI94l%2FY30tyF8vVcCWqX3ythlxuJ2Przu5f3s%2Boc%2FiihZQn6ZbdiTjjJkoJHH7tFvTZvVkWB05Tf1voQDAsU150EOFpMeMr8Ei0eBIb5RfHjQTXOit2A5BL2lqCwc%3D\" rel=\"nofollow\">\u534e\u4e3a\u5f00\u53d1\u8005\u8054\u76df\u5b98\u7f51<\/a>\u3002<\/p>\n<h4>2.    \u5730\u70b9\u8be6\u60c5<\/h4>\n<pre><code>\/\/ \u58f0\u660eSearchService\u5bf9\u8c61 \nprivate SearchService searchService; \n\/\/ \u521b\u5efaSearchService\u5b9e\u4f8b \nsearchService = SearchServiceFactory.create(this, &quot;\nAPI key\n&quot;);\n\/\/ \u521b\u5efa\u8bf7\u6c42\u4f53 \nDetailSearchRequest request = new DetailSearchRequest(); \nrequest.setSiteId(&quot;\nC2B922CC4651907A1C463127836D3957\n&quot;); \nrequest.setLanguage(&quot;\nfr\n&quot;); \nrequest.setChildren(\nfalse\n);\n\/\/ \u521b\u5efa\u641c\u7d22\u7ed3\u679c\u4fa6\u542c\u5668 \nSearchResultListener&lt;DetailSearchResponse&gt; resultListener = new SearchResultListener&lt;DetailSearchResponse&gt;() { \n    \/\/ \u6b63\u5e38\u7ed3\u679c\u8fd4\u56de \n    @Override \n    public void onSearchResult(DetailSearchResponse result) { \n        Site site;\n        if (result == null || (site = result.getSite()) == null) { \n            return; \n        }\n         Log.i(&quot;TAG&quot;, String.format(&quot;siteId: '%s', name: %s\/r\/n&quot;, site.getSiteId(), site.getName())); \n    } \n    \/\/ \u5f02\u5e38\u7ed3\u679c\u8fd4\u56de \n    @Override \n    public void onSearchError(SearchStatus status) { \n        Log.i(&quot;TAG&quot;, &quot;Error : &quot; + status.getErrorCode() + &quot; &quot; + status.getErrorMessage()); \n    } \n}; \n\/\/ \u8c03\u7528\u5730\u70b9\u8be6\u60c5\u63a5\u53e3 \nsearchService.detailSearch(request, resultListener);<\/code><\/pre>\n<p><strong>\u4e86\u89e3\u66f4\u591a\u8be6\u60c5&gt;&gt;<\/strong><\/p>\n<p>\u8bbf\u95ee<a href=\"https:\/\/link.segmentfault.com\/?enc=rCml4j%2BmR5qfWNTYZDXfCw%3D%3D.PNXvcD%2BO6zT26sqPhFYBE%2BF9t8fIRMUr0qLlGoEnSJvCn8PdeYadK7yZP9%2FHt2xuDyqtwpgdHMeXbG5O8HocUg%3D%3D\" rel=\"nofollow\">\u534e\u4e3a\u5f00\u53d1\u8005\u8054\u76df\u5b98\u7f51<\/a>  <br \/>\u83b7\u53d6<a href=\"https:\/\/link.segmentfault.com\/?enc=tf07qBQZQ8KZUStyskvr6Q%3D%3D.XFDmZSzjvm2u5Tho1GvLSHnKE0WqZ223jdZ%2FqAMl1oprU6ZiB6dZfCUC9k4O3fsggsnl4D26vZfGRU1DVT6NoSFoUTV9Ouaj4uEfLUY8b5A%3D\" rel=\"nofollow\">\u5f00\u53d1\u6307\u5bfc\u6587\u6863<\/a>  <br \/>\u534e\u4e3a\u79fb\u52a8\u670d\u52a1\u5f00\u6e90\u4ed3\u5e93\u5730\u5740\uff1a<a href=\"https:\/\/link.segmentfault.com\/?enc=3zg0p3EWX%2BBJyZnH5muqjQ%3D%3D.EvW2ekrBPMfQGnv4PwYBfczlFRNbCAEyB1xccHNwUaE%3D\" rel=\"nofollow\">GitHub<\/a>\u3001<a href=\"https:\/\/link.segmentfault.com\/?enc=pTWPREkcFV%2FFtGEJJj3aBA%3D%3D.2SG3l5Efvzi31dtK8tIlBQHkonbyXfQ3VPXOtuTfda0%3D\" rel=\"nofollow\">Gitee<\/a><\/p>\n<p><strong>\u5173\u6ce8\u6211\u4eec\uff0c\u7b2c\u4e00\u65f6\u95f4\u4e86\u89e3 HMS Core \u6700\u65b0\u6280\u672f\u8d44\u8baf~<\/strong><\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042337575\">https:\/\/segmentfault.com\/a\/1190000042337575<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528\u6237\u5728App\u91cc\u641c\u7d22\u67d0\u4e2a\u5730\u70b9\u65f6\uff0c\u5e76\u4e0d\u6ee1\u8db3\u5355\u4e00\u7684\u5730\u70b9\u4fe1\u606f\uff0c\u5e0c\u671b\u5f97\u5230\u66f4\u591a\u53ef\u4ee5\u5e2e\u52a9\u5176\u505a\u51b3\u7b56\u7684\u6df1\u5ea6\u4fe1\u606f\u3002\u4f8b\u5982\u6709\u6253\u8f66\u51fa\u884c\u9700 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006242","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006242"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006242\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}