{"id":5530,"date":"2026-02-25T22:35:04","date_gmt":"2026-02-25T14:35:04","guid":{"rendered":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps"},"modified":"2026-02-25T22:35:04","modified_gmt":"2026-02-25T14:35:04","slug":"trajectory-recording-function-implementation-steps","status":"publish","type":"post","link":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps","title":{"rendered":"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4"},"content":{"rendered":"<p>\u5b9e\u73b0\u4e00\u4e2a\u5065\u58ee\u7684\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\uff0c\u8fdc\u4e0d\u6b62\u662f\u8c03\u7528\u51e0\u4e2a\u5b9a\u4f4dAPI\u90a3\u4e48\u7b80\u5355\u3002\u5b83\u662f\u4e00\u9879\u6d89\u53ca\u6743\u9650\u7ba1\u7406\u3001\u6570\u636e\u91c7\u96c6\u7b56\u7565\u3001\u7b97\u6cd5\u4f18\u5316\u3001\u6301\u4e45\u5316\u65b9\u6848\u4ee5\u53ca\u529f\u8017\u63a7\u5236\u7684\u7cfb\u7edf\u5de5\u7a0b\u3002\u5728\u6211\u770b\u6765\uff0c\u4e00\u4e2a\u4f18\u79c0\u7684\u8f68\u8ff9\u8bb0\u5f55\u6a21\u5757\uff0c\u5176\u4ef7\u503c\u4e0d\u4ec5\u5728\u4e8e\u753b\u51fa\u4e00\u6761\u7ebf\uff0c\u66f4\u5728\u4e8e\u8fd9\u6761\u7ebf\u7684\u8d28\u91cf\u3001\u7a33\u5b9a\u6027\u548c\u5bf9\u7528\u6237\u8bbe\u5907\u8d44\u6e90\u7684\u5c0a\u91cd\u3002<\/p>\n<h2>TL;DR\uff1a\u6838\u5fc3\u6b65\u9aa4\u901f\u89c8<\/h2>\n<ul>\n<li><strong>\u7b2c\u4e00\u6b65\uff1a\u83b7\u53d6\u6743\u9650<\/strong>\uff1a\u5728Android (<code>AndroidManifest.xml<\/code>) \u548c iOS (<code>Info.plist<\/code>) \u4e2d\u58f0\u660e\u5b9a\u4f4d\u6743\u9650\uff0c\u5e76\u7f16\u5199\u4ee3\u7801\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u8bf7\u6c42\u7528\u6237\u6388\u6743\u3002\u8fd9\u662f\u6240\u6709\u5de5\u4f5c\u7684\u524d\u63d0\u3002<\/li>\n<li><strong>\u7b2c\u4e8c\u6b65\uff1a\u91c7\u96c6\u6570\u636e<\/strong>\uff1a\u9009\u62e9\u5408\u9002\u7684\u5b9a\u4f4d\u7b56\u7565\uff08GPS\/\u7f51\u7edc\/\u878d\u5408\uff09\uff0c\u4f7f\u7528\u5e73\u53f0\u539f\u751fAPI\uff08Android <code>FusedLocationProviderClient<\/code> \/ iOS <code>CLLocationManager<\/code>\uff09\u6301\u7eed\u83b7\u53d6\u5750\u6807\u70b9\u3002<\/li>\n<li><strong>\u7b2c\u4e09\u6b65\uff1a\u4f18\u5316\u5904\u7406<\/strong>\uff1a\u5e94\u7528\u8f68\u8ff9\u5e73\u6ed1\u7b97\u6cd5\uff08\u5982\u5361\u5c14\u66fc\u6ee4\u6ce2\uff09\u548c\u7ea0\u504f\u6280\u672f\uff08\u5982\u9053\u8def\u5438\u9644\uff09\u5904\u7406\u5b9a\u4f4d\u6f02\u79fb\u548c\u566a\u70b9\uff0c\u8fd9\u662f\u51b3\u5b9a\u8f68\u8ff9\u8d28\u91cf\u7684\u5173\u952e\u3002<\/li>\n<li><strong>\u7b2c\u56db\u6b65\uff1a\u5b58\u50a8\u4e0e\u5c55\u793a<\/strong>\uff1a\u5c06\u5904\u7406\u540e\u7684\u5750\u6807\u70b9\u6570\u636e\u8fdb\u884c\u672c\u5730\u6216\u4e91\u7aef\u6301\u4e45\u5316\uff0c\u5e76\u4f7f\u7528\u5730\u56feSDK\uff08\u5982\u9ad8\u5fb7\u5730\u56fe, Mapbox\uff09\u7684Polyline\u529f\u80fd\u5728\u524d\u7aef\u7ed8\u5236\u8f68\u8ff9\u3002<\/li>\n<li><strong>\u7b2c\u4e94\u6b65\uff1a\u6027\u80fd\u4f18\u5316<\/strong>\uff1a\u901a\u8fc7\u667a\u80fd\u8c03\u6574\u5b9a\u4f4d\u9891\u7387\u3001\u6279\u91cf\u4e0a\u4f20\u6570\u636e\u3001\u7ed3\u5408\u8bbe\u5907\u72b6\u6001\u7b49\u65b9\u5f0f\uff0c\u4e25\u683c\u63a7\u5236\u7535\u91cf\u6d88\u8017\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002<\/li>\n<\/ul>\n<h2>\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u7684\u6574\u4f53\u67b6\u6784\u4e0e\u6838\u5fc3\u6d41\u7a0b<\/h2>\n<h3>\u4e3a\u4ec0\u4e48\u8f68\u8ff9\u8bb0\u5f55\u662f\u73b0\u4ee3App\u7684\u5173\u952e\u4e00\u73af\uff1f<\/h3>\n<p>\u4ece\u7269\u6d41\u884c\u4e1a\u7684\u8d27\u7269\u8ffd\u8e2a\u3001\u8fd0\u52a8\u5065\u8eabApp\u7684\u8def\u7ebf\u8bb0\u5f55\uff0c\u5230\u5171\u4eab\u51fa\u884c\u7684\u8f66\u8f86\u8c03\u5ea6\uff0c\u8f68\u8ff9\u8bb0\u5f55\u65e9\u5df2\u6210\u4e3a\u8fde\u63a5\u6570\u5b57\u4e16\u754c\u4e0e\u7269\u7406\u4e16\u754c\u7684\u5173\u952e\u6280\u672f\u3002\u5b83\u4e0d\u4ec5\u662f\u529f\u80fd\uff0c\u66f4\u662f\u6570\u636e\u8d44\u4ea7\u3002\u4e00\u6761\u9ad8\u8d28\u91cf\u7684\u8f68\u8ff9\u53ef\u4ee5\u7528\u4e8e\u91cc\u7a0b\u8ba1\u7b97\u3001\u884c\u4e3a\u5206\u6790\u3001\u8def\u5f84\u4f18\u5316\uff0c\u5176\u5546\u4e1a\u4ef7\u503c\u4e0d\u8a00\u800c\u55bb\u3002\u56e0\u6b64\uff0c\u6784\u5efa\u4e00\u4e2a\u7a33\u5b9a\u3001\u7cbe\u51c6\u4e14\u4f4e\u8017\u7684\u8f68\u8ff9\u8bb0\u5f55\u7cfb\u7edf\uff0c\u662f\u8bb8\u591a\u5e94\u7528\u7684\u6838\u5fc3\u7ade\u4e89\u529b\u4e4b\u4e00\u3002<\/p>\n<h3>\u6570\u636e\u6d41\u8f6c\u5168\u666f\u56fe\uff1a\u4ece\u91c7\u96c6\u5230\u5c55\u793a\u7684\u5b8c\u6574\u94fe\u8def<\/h3>\n<p>\u8981\u6784\u5efa\u4e00\u4e2a\u5de5\u4e1a\u7ea7\u7684\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\uff0c\u4f60\u9996\u5148\u9700\u8981\u5efa\u7acb\u4e00\u4e2a\u6e05\u6670\u7684\u7cfb\u7edf\u67b6\u6784\u6982\u5ff5\u3002\u6574\u4e2a\u6570\u636e\u751f\u547d\u5468\u671f\u53ef\u4ee5\u88ab\u6e05\u6670\u5730\u5212\u5206\u4e3a\u56db\u4e2a\u5c42\u6b21\uff1a<\/p>\n<ul>\n<li><strong>\u6570\u636e\u91c7\u96c6\u5c42<\/strong>\uff1a\u8fd9\u662f\u6240\u6709\u6570\u636e\u7684\u57fa\u7840\u3002\u901a\u8fc7\u79fb\u52a8\u8bbe\u5907\u5185\u7f6e\u7684\u4f20\u611f\u5668\uff08GPS\u3001\u57fa\u7ad9\u3001Wi-Fi\uff09\u83b7\u53d6\u5305\u542b\u7ecf\u7eac\u5ea6\u3001\u901f\u5ea6\u3001\u7cbe\u5ea6\u3001\u65f6\u95f4\u6233\u7b49\u4fe1\u606f\u7684\u539f\u59cb\u5750\u6807\u6570\u636e\u3002<\/li>\n<li><strong>\u6570\u636e\u5904\u7406\u5c42<\/strong>\uff1a\u539f\u59cb\u6570\u636e\u662f\u4e0d\u53ef\u9760\u7684\uff0c\u5145\u6ee1\u4e86\u566a\u70b9\u548c\u6f02\u79fb\u3002\u8fd9\u4e00\u5c42\u8d1f\u8d23\u5bf9\u539f\u59cb\u6570\u636e\u8fdb\u884c\u53bb\u566a\u3001\u5e73\u6ed1\u3001\u62bd\u7a00\u3001\u7ea0\u504f\u7b49\u4e00\u7cfb\u5217\u7b97\u6cd5\u5904\u7406\uff0c\u4ea7\u51fa\u201c\u5e72\u51c0\u201d\u7684\u8f68\u8ff9\u6570\u636e\u3002<\/li>\n<li><strong>\u6570\u636e\u5b58\u50a8\u5c42<\/strong>\uff1a\u5c06\u5904\u7406\u540e\u7684\u8f68\u8ff9\u6570\u636e\u5b58\u50a8\u4e8e\u672c\u5730\u6570\u636e\u5e93\uff08\u5982SQLite\uff09\u6216\u4e0a\u4f20\u81f3\u4e91\u7aef\u670d\u52a1\u5668\uff08\u5982PostGIS\uff09\u3002\u9009\u62e9\u4f55\u79cd\u65b9\u6848\u53d6\u51b3\u4e8e\u4f60\u7684\u4e1a\u52a1\u662f\u5426\u9700\u8981\u591a\u7aef\u540c\u6b65\u6216\u540e\u7aef\u5206\u6790\u3002<\/li>\n<li><strong>\u6570\u636e\u5c55\u793a\u5c42<\/strong>\uff1a\u6700\u7ec8\uff0c\u901a\u8fc7\u5730\u56feSDK\u5c06\u4e00\u7cfb\u5217\u5750\u6807\u70b9\u8fde\u63a5\u6210\u7ebf\uff0c\u53ef\u89c6\u5316\u5730\u5728\u5730\u56fe\u4e0a\u5448\u73b0\u7528\u6237\u7684\u8fd0\u52a8\u8f68\u8ff9\u3002<\/li>\n<\/ul>\n<p><em>(\u6b64\u5904\u5e94\u914d\u4e00\u5f20\u6e05\u6670\u7684\u7cfb\u7edf\u67b6\u6784\u56fe\u6216\u6570\u636e\u6d41\u7a0b\u56fe)<\/em><\/p>\n<h2>\u7b2c\u4e00\u6b65\uff1a\u57fa\u7840\u51c6\u5907 - \u83b7\u53d6\u5b9a\u4f4d\u6743\u9650\u4e0eSDK\u96c6\u6210<\/h2>\n<p>\u5728\u5199\u4e0b\u4efb\u4f55\u4e00\u884c\u5b9a\u4f4d\u4ee3\u7801\u4e4b\u524d\uff0c\u9996\u8981\u4efb\u52a1\u662f\u6b63\u786e\u914d\u7f6e\u5e76\u5411\u7528\u6237\u8bf7\u6c42\u5b9a\u4f4d\u6743\u9650\u3002\u8fd9\u662f\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u548c\u7528\u6237\u5efa\u7acb\u4fe1\u4efb\u7684\u7b2c\u4e00\u6b65\uff0c\u5904\u7406\u4e0d\u597d\uff0c\u540e\u7eed\u4e00\u5207\u90fd\u662f\u7a7a\u8c08\u3002<\/p>\n<h3>Android\u6743\u9650\u914d\u7f6e (AndroidManifest.xml)<\/h3>\n<p>\u5728Android\u4e2d\uff0c\u6743\u9650\u7ba1\u7406\u968f\u7740\u7cfb\u7edf\u7248\u672c\u7684\u8fed\u4ee3\u53d8\u5f97\u6108\u53d1\u4e25\u683c\u3002<\/p>\n<ol>\n<li>\u5728 <code>AndroidManifest.xml<\/code> \u6587\u4ef6\u4e2d\u58f0\u660e\u5fc5\u8981\u7684\u6743\u9650\u3002\n<pre><code class=\"language-xml\"><uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" \/><uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" \/><\/code><\/pre>\n<\/li>\n<li>\u5982\u679c\u4f60\u9700\u8981App\u5728\u540e\u53f0\u4e5f\u80fd\u6301\u7eed\u8bb0\u5f55\u8f68\u8ff9\uff0c\u90a3\u4e48\u9488\u5bf9Android 10 (API 29)\u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u8fd8\u5fc5\u987b\u6dfb\u52a0\u540e\u53f0\u5b9a\u4f4d\u6743\u9650\u3002\n<pre><code class=\"language-xml\"><uses-permission android:name=\"android.permission.ACCESS_BACKGROUND_LOCATION\" \/><\/code><\/pre>\n<\/li>\n<li>\u6700\u540e\uff0c\u4f60\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u5904\u7406\u8fd0\u884c\u65f6\u6743\u9650\u7684\u52a8\u6001\u8bf7\u6c42\u903b\u8f91\u3002\u5728\u89e6\u53d1\u5b9a\u4f4d\u529f\u80fd\u524d\uff0c\u68c0\u67e5\u6743\u9650\u72b6\u6001\uff0c\u5982\u679c\u672a\u88ab\u6388\u4e88\uff0c\u5219\u5411\u7528\u6237\u53d1\u8d77\u8bf7\u6c42\u3002\u8fd9\u90e8\u5206\u903b\u8f91\u662f\u4fdd\u8bc1App\u5065\u58ee\u6027\u7684\u57fa\u7840\u3002<\/li>\n<\/ol>\n<p><em>(\u6b64\u5904\u5e94\u914d\u6709AndroidManifest.xml\u914d\u7f6e\u7684\u4ee3\u7801\u793a\u4f8b\u622a\u56fe)<\/em><\/p>\n<h3>iOS\u6743\u9650\u914d\u7f6e (Info.plist)<\/h3>\n<p>iOS\u5bf9\u7528\u6237\u9690\u79c1\u7684\u4fdd\u62a4\u4e00\u76f4\u975e\u5e38\u4e25\u683c\uff0c\u56e0\u6b64\u6743\u9650\u914d\u7f6e\u548c\u6587\u6848\u8bf4\u660e\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<ol>\n<li>\u5728 <code>Info.plist<\/code> \u6587\u4ef6\u4e2d\uff0c\u5fc5\u987b\u6dfb\u52a0\u5411\u7528\u6237\u89e3\u91ca\u4e3a\u4f55\u9700\u8981\u5b9a\u4f4d\u6743\u9650\u7684\u63cf\u8ff0\u6587\u6848\u3002\u8fd9\u4e24\u4e2a\u952e\u503c\u5bf9\u662f\u7ed5\u4e0d\u8fc7\u7684\uff1a\n<ul>\n<li><code>NSLocationWhenInUseUsageDescription<\/code>: \u89e3\u91ca\u4e3a\u4ec0\u4e48\u5728App\u4f7f\u7528\u671f\u95f4\u9700\u8981\u5b9a\u4f4d\u3002<\/li>\n<li><code>NSLocationAlwaysAndWhenInUseUsageDescription<\/code>: \u89e3\u91ca\u4e3a\u4ec0\u4e48\u9700\u8981\u59cb\u7ec8\u5141\u8bb8\u5b9a\u4f4d\uff08\u7528\u4e8e\u540e\u53f0\u5b9a\u4f4d\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u4e3a\u4e86\u5b9e\u73b0\u540e\u53f0\u5b9a\u4f4d\uff0c\u4f60\u8fd8\u9700\u8981\u5728\u9879\u76ee\u7684 \"Signing & Capabilities\" \u6807\u7b7e\u9875\u4e2d\uff0c\u70b9\u51fb \"+ Capability\" \u6dfb\u52a0 \"Background Modes\"\uff0c\u5e76\u786e\u4fdd\u52fe\u9009 \"Location updates\"\u3002<\/li>\n<\/ol>\n<p><em>(\u6b64\u5904\u5e94\u914d\u6709Info.plist\u914d\u7f6e\u7684\u622a\u56fe)<\/em><\/p>\n<h3>\u6838\u5fc3\u5b9a\u4f4dSDK\u7684\u9009\u62e9\u4e0e\u8003\u91cf<\/h3>\n<ul>\n<li><strong>\u539f\u751fAPI<\/strong>\uff1aAndroid\u7684<code>FusedLocationProviderClient<\/code>\u4e0eiOS\u7684<code>CLLocationManager<\/code>\u662f\u5b98\u65b9\u9996\u9009\u3002\u5b83\u4eec\u8db3\u591f\u8f7b\u91cf\uff0c\u4e14\u80fd\u8ba9\u4f60\u5bf9\u5b9a\u4f4d\u53c2\u6570\u6709\u6700\u7cbe\u7ec6\u7684\u63a7\u5236\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u7eaf\u7cb9\u7684\u8f68\u8ff9\u8bb0\u5f55\u9700\u6c42\uff0c\u6211\u66f4\u503e\u5411\u4e8e\u4f7f\u7528\u539f\u751fAPI\u3002<\/li>\n<li><strong>\u7b2c\u4e09\u65b9\u5730\u56feSDK<\/strong>\uff1a\u9ad8\u5fb7\u5730\u56fe\u3001\u767e\u5ea6\u5730\u56fe\u3001Google Maps\u7b49\u90fd\u63d0\u4f9b\u4e86\u5c01\u88c5\u597d\u7684\u5b9a\u4f4d\u670d\u52a1\u3002\u5b83\u4eec\u7684\u4f18\u52bf\u5728\u4e8e\u901a\u5e38\u96c6\u6210\u4e86\u66f4\u6210\u719f\u7684\u5b9a\u4f4d\u7b97\u6cd5\u3001\u7f51\u7edc\u5b9a\u4f4dIP\u5e93\u4ee5\u53ca\u5730\u56fe\u751f\u6001\uff08\u5982POI\u641c\u7d22\u3001\u8def\u5f84\u89c4\u5212\uff09\u3002\u5982\u679c\u4f60\u7684\u5e94\u7528\u5f3a\u4f9d\u8d56\u4e8e\u67d0\u4e00\u5bb6\u7684\u5730\u56fe\u751f\u6001\uff0c\u4f7f\u7528\u5176\u63d0\u4f9b\u7684\u5b9a\u4f4dSDK\u4f1a\u66f4\u65b9\u4fbf\u3002<\/li>\n<\/ul>\n<h2>\u7b2c\u4e8c\u6b65\uff1a\u6838\u5fc3\u5b9e\u73b0 - \u91c7\u96c6\u4e0e\u8bb0\u5f55\u5750\u6807\u6570\u636e<\/h2>\n<p>\u6743\u9650\u4e0eSDK\u5c31\u7eea\u540e\uff0c\u6211\u4eec\u6b63\u5f0f\u8fdb\u5165\u6838\u5fc3\u7684\u6570\u636e\u91c7\u96c6\u9636\u6bb5\u3002\u8fd9\u91cc\u7684\u5173\u952e\u5728\u4e8e\u7406\u89e3\u4e0d\u540c\u5b9a\u4f4d\u7b56\u7565\u7684\u4f18\u7f3a\u70b9\uff0c\u5e76\u6839\u636e\u573a\u666f\u505a\u51fa\u6b63\u786e\u9009\u62e9\u3002<\/p>\n<h3>\u5b9a\u4f4d\u7b56\u7565\u9009\u62e9\uff1aGPS\u3001\u7f51\u7edc\u4e0e\u878d\u5408\u5b9a\u4f4d\u7684\u535a\u5f08<\/h3>\n<p>\u4e0d\u5b58\u5728\u4e00\u79cd\u201c\u6700\u597d\u201d\u7684\u5b9a\u4f4d\u65b9\u5f0f\uff0c\u53ea\u6709\u201c\u6700\u9002\u5408\u201d\u7684\u3002\u4f60\u9700\u8981\u50cf\u4e00\u4e2a\u8d44\u6e90\u8c03\u5ea6\u5e08\u4e00\u6837\uff0c\u5728\u7cbe\u5ea6\u3001\u529f\u8017\u548c\u901f\u5ea6\u4e4b\u95f4\u505a\u51fa\u6743\u8861\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th align=\"left\">\u5b9a\u4f4d\u65b9\u5f0f<\/th>\n<th align=\"left\">\u4f18\u70b9<\/th>\n<th align=\"left\">\u7f3a\u70b9<\/th>\n<th align=\"left\">\u9002\u7528\u573a\u666f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><strong>GPS\u5b9a\u4f4d<\/strong><\/td>\n<td align=\"left\">\u7cbe\u5ea6\u9ad8\uff08\u901a\u5e38\u57285-15\u7c73\uff09\u3001\u5168\u7403\u8986\u76d6<\/td>\n<td align=\"left\">\u529f\u8017\u6781\u5927\u3001\u51b7\u542f\u52a8\u6162\u3001\u5ba4\u5185\u6216\u9ad8\u697c\u6797\u7acb\u533a\u57df\u4fe1\u53f7\u5f31<\/td>\n<td align=\"left\">\u6237\u5916\u8fd0\u52a8\uff08\u8dd1\u6b65\u3001\u9a91\u884c\uff09\u3001\u8f66\u8f86\u5bfc\u822a\u3001\u6d4b\u7ed8<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>\u7f51\u7edc\u5b9a\u4f4d<\/strong><\/td>\n<td align=\"left\">\u529f\u8017\u4f4e\u3001\u542f\u52a8\u901f\u5ea6\u5feb\u3001\u5ba4\u5185\u53ef\u7528<\/td>\n<td align=\"left\">\u7cbe\u5ea6\u8f83\u4f4e\uff08\u51e0\u5341\u5230\u51e0\u767e\u7c73\uff09\u3001\u4f9d\u8d56\u57fa\u7ad9\u548cWi-Fi\u70ed\u70b9<\/td>\n<td align=\"left\">\u57ce\u5e02\u5185\u65e5\u5e38\u7b7e\u5230\u3001\u5468\u8fb9\u4fe1\u606f\u641c\u7d22\u3001\u5929\u6c14\u5e94\u7528<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>\u878d\u5408\u5b9a\u4f4d<\/strong><\/td>\n<td align=\"left\">\u5e73\u8861\u4e86\u7cbe\u5ea6\u4e0e\u529f\u8017\uff0c\u667a\u80fd\u5207\u6362<\/td>\n<td align=\"left\">\u7b97\u6cd5\u5b9e\u73b0\u76f8\u5bf9\u590d\u6742\uff0c\u4f9d\u8d56\u7cfb\u7edf\u5e95\u5c42\u4f18\u5316<\/td>\n<td align=\"left\">\u5927\u591a\u6570\u9700\u8981\u8fde\u7eed\u8f68\u8ff9\u8bb0\u5f55\u7684\u5e94\u7528\uff0c\u5982\u5916\u52e4\u3001\u7269\u6d41<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5bf9\u4e8e\u7edd\u5927\u591a\u6570\u8f68\u8ff9\u8bb0\u5f55\u5e94\u7528\uff0c\u6211\u7684\u5efa\u8bae\u662f\u76f4\u63a5\u4f7f\u7528\u7cfb\u7edf\u63d0\u4f9b\u7684<strong>\u878d\u5408\u5b9a\u4f4d<\/strong>\u65b9\u6848\uff08<code>FusedLocationProviderClient<\/code>\u548c<code>CLLocationManager<\/code>\u9ed8\u8ba4\u5c31\u662f\u878d\u5408\u5b9a\u4f4d\uff09\uff0c\u8ba9\u64cd\u4f5c\u7cfb\u7edf\u53bb\u667a\u80fd\u5730\u7ba1\u7406GPS\u3001Wi-Fi\u548c\u57fa\u7ad9\uff0c\u4f60\u53ea\u9700\u8981\u8bbe\u5b9a\u597d\u671f\u671b\u7684\u7cbe\u5ea6\u548c\u9891\u7387\u5373\u53ef\u3002<\/p>\n<h3>Android\u5b9e\u73b0\uff1a\u4f7f\u7528FusedLocationProviderClient<\/h3>\n<p><code>FusedLocationProviderClient<\/code> \u662fGoogle\u5b98\u65b9\u63a8\u8350\u7684API\uff0c\u5b83\u6781\u5927\u5730\u7b80\u5316\u4e86\u5b9a\u4f4d\u5f00\u53d1\u3002<\/p>\n<ol>\n<li><strong>\u914d\u7f6e <code>LocationRequest<\/code><\/strong>\uff1a\u8fd9\u662f\u5b9a\u4e49\u4f60\u5b9a\u4f4d\u9700\u6c42\u7684\u5bf9\u8c61\u3002\n<pre><code class=\"language-kotlin\">val locationRequest = LocationRequest.create().apply {    interval = 5000 \/\/ \u5b9a\u4f4d\u66f4\u65b0\u7684\u671f\u671b\u95f4\u9694\uff0c\u5355\u4f4d\u6beb\u79d2    fastestInterval = 2000 \/\/ \u5b9a\u4f4d\u66f4\u65b0\u7684\u6700\u5feb\u95f4\u9694    priority = LocationRequest.PRIORITY_HIGH_ACCURACY \/\/ \u4f18\u5148\u4f7f\u7528\u9ad8\u7cbe\u5ea6\u5b9a\u4f4d\uff08GPS\uff09}<\/code><\/pre>\n<\/li>\n<li><strong>\u521b\u5efa <code>LocationCallback<\/code> \u5e76\u542f\u52a8\u5b9a\u4f4d<\/strong>\uff1a\u521b\u5efa\u4e00\u4e2a\u56de\u8c03\uff0c\u7528\u4e8e\u63a5\u6536\u7cfb\u7edf\u8fd4\u56de\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u7136\u540e\u542f\u52a8\u5b9a\u4f4d\u66f4\u65b0\u3002\n<pre><code class=\"language-kotlin\">locationCallback = object : LocationCallback() {    override fun onLocationResult(locationResult: LocationResult?) {        locationResult ?: return        for (location in locationResult.locations){            \/\/ \u5728\u8fd9\u91cc\u5904\u7406\u83b7\u53d6\u5230\u7684location\u5bf9\u8c61            \/\/ \u4f8b\u5982\uff1a\u5c06\u5750\u6807\u70b9\u5b58\u5165\u6570\u636e\u5e93        }    }}fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper())<\/code><\/pre>\n<\/li>\n<\/ol>\n<p><em>(\u6b64\u5904\u5e94\u914d\u6709\u5173\u952e\u7684Java\/Kotlin\u4ee3\u7801\u793a\u4f8b)<\/em><\/p>\n<h3>iOS\u5b9e\u73b0\uff1a\u914d\u7f6eCLLocationManager<\/h3>\n<p>\u5728iOS\u4e2d\uff0c<code>CLLocationManager<\/code> \u662f\u8d1f\u8d23\u6240\u6709\u4f4d\u7f6e\u670d\u52a1\u7684\u6838\u5fc3\u7c7b\u3002<\/p>\n<ol>\n<li><strong>\u914d\u7f6e <code>CLLocationManager<\/code> \u5b9e\u4f8b<\/strong>\uff1a\u8bbe\u7f6e\u7cbe\u5ea6\u3001\u8ddd\u79bb\u8fc7\u6ee4\u5668\u7b49\u5173\u952e\u5c5e\u6027\u3002\n<pre><code class=\"language-swift\">let locationManager = CLLocationManager()locationManager.delegate = selflocationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation \/\/ \u8bbe\u7f6e\u671f\u671b\u7cbe\u5ea6\uff0c\u5bfc\u822a\u7ea7\u522blocationManager.distanceFilter = 10.0 \/\/ \u8bbe\u5907\u79fb\u52a8\u8d85\u8fc710\u7c73\u624d\u89e6\u53d1\u66f4\u65b0locationManager.allowsBackgroundLocationUpdates = true \/\/ \u5141\u8bb8\u540e\u53f0\u4f4d\u7f6e\u66f4\u65b0locationManager.pausesLocationUpdatesAutomatically = false \/\/ \u9632\u6b62\u7cfb\u7edf\u81ea\u52a8\u6682\u505c\u66f4\u65b0<\/code><\/pre>\n<\/li>\n<li><strong>\u5b9e\u73b0 <code>CLLocationManagerDelegate<\/code> \u534f\u8bae<\/strong>\uff1a\u901a\u8fc7\u4ee3\u7406\u65b9\u6cd5\u63a5\u6536\u4f4d\u7f6e\u66f4\u65b0\u3001\u6743\u9650\u53d8\u5316\u7b49\u4e8b\u4ef6\u3002\n<pre><code class=\"language-swift\">func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {    guard let location = locations.last else { return }    \/\/ \u5728\u8fd9\u91cc\u5904\u7406\u83b7\u53d6\u5230\u7684CLLocation\u5bf9\u8c61    \/\/ \u6ce8\u610f\u68c0\u67e5\u5176horizontalAccuracy\u5c5e\u6027\uff0c\u8fc7\u6ee4\u6389\u7cbe\u5ea6\u8fc7\u4f4e\u7684\u70b9}<\/code><\/pre>\n<\/li>\n<\/ol>\n<p><em>(\u6b64\u5904\u5e94\u914d\u6709\u5173\u952e\u7684Swift\/Objective-C\u4ee3\u7801\u793a\u4f8b)<\/em><\/p>\n<h3>\u5173\u952e\u6311\u6218\uff1a\u540e\u53f0\u6301\u7eed\u5b9a\u4f4d\u4e0e\u4fdd\u6d3b\u7b56\u7565<\/h3>\n<p>\u8fd9\u662f\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u4e2d\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u73af\u8282\uff0c\u56e0\u4e3aAndroid\u548ciOS\u7cfb\u7edf\u51fa\u4e8e\u7701\u7535\u8003\u8651\uff0c\u4f1a\u4e25\u683c\u9650\u5236\u540e\u53f0\u884c\u4e3a\u3002<\/p>\n<ul>\n<li><strong>Android<\/strong>\uff1a\u552f\u4e00\u7684\u5b98\u65b9\u6b63\u9014\u662f\u4f7f\u7528<strong>\u524d\u53f0\u670d\u52a1 (Foreground Service)<\/strong>\u3002\u4f60\u5fc5\u987b\u521b\u5efa\u4e00\u4e2a\u670d\u52a1\uff0c\u5e76\u5728\u5176\u542f\u52a8\u65f6\u8c03\u7528 <code>startForeground()<\/code> \u65b9\u6cd5\uff0c\u540c\u65f6\u663e\u793a\u4e00\u4e2a\u5e38\u9a7b\u7684\u7cfb\u7edf\u901a\u77e5\u3002\u8fd9\u4f1a\u544a\u8bc9\u7cfb\u7edf\uff1a\u201c\u6211\u7684\u5e94\u7528\u6b63\u5728\u6267\u884c\u4e00\u9879\u5bf9\u7528\u6237\u5f88\u91cd\u8981\u7684\u540e\u53f0\u4efb\u52a1\uff0c\u8bf7\u4e0d\u8981\u8f7b\u6613\u6740\u6b7b\u6211\u3002\u201d \u4efb\u4f55\u8bd5\u56fe\u901a\u8fc7\u5176\u4ed6\u201c\u9ed1\u79d1\u6280\u201d\u4fdd\u6d3b\u7684\u624b\u6bb5\uff0c\u5728\u65b0\u7684Android\u7248\u672c\u4e0a\u90fd\u6ce8\u5b9a\u4f1a\u5931\u8d25\u3002<\/li>\n<li><strong>iOS<\/strong>\uff1a\u9664\u4e86\u4e4b\u524d\u63d0\u5230\u7684\u914d\u7f6e <code>Background Modes<\/code> \u548c <code>allowsBackgroundLocationUpdates<\/code> \u5c5e\u6027\u5916\uff0c\u8fd8\u9700\u8981\u6ce8\u610f\u5904\u7406\u7cfb\u7edf\u53ef\u80fd\u56e0\u4e3a\u957f\u65f6\u95f4\u9759\u6b62\u800c\u81ea\u52a8\u6682\u505c\u4f4d\u7f6e\u66f4\u65b0\u7684\u60c5\u51b5 (<code>pausesLocationUpdatesAutomatically<\/code>)\u3002\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u5c06\u5176\u8bbe\u7f6e\u4e3a <code>false<\/code>\uff0c\u4f46\u8fd9\u4f1a\u589e\u52a0\u7535\u91cf\u6d88\u8017\uff0c\u9700\u8981\u8c28\u614e\u8bc4\u4f30\u3002<\/li>\n<\/ul>\n<h2>\u7b2c\u4e09\u6b65\uff1a\u6570\u636e\u4f18\u5316 - \u8f68\u8ff9\u5e73\u6ed1\u4e0e\u7ea0\u504f\u5904\u7406<\/h2>\n<h3>\u4e3a\u4ec0\u4e48\u5fc5\u987b\u8fdb\u884c\u8f68\u8ff9\u4f18\u5316\uff1f\u76f4\u9762\u5b9a\u4f4d\u6f02\u79fb\u4e0e\u566a\u70b9<\/h3>\n<p>\u4ece\u8bbe\u5907\u83b7\u53d6\u7684\u539f\u59cb\u5b9a\u4f4d\u6570\u636e\u662f\u201c\u7c97\u7cd9\u201d\u4e14\u4e0d\u53ef\u4fe1\u7684\u3002\u7531\u4e8e\u4fe1\u53f7\u88ab\u9ad8\u697c\u53cd\u5c04\uff08\u591a\u5f84\u6548\u5e94\uff09\u3001GPS\u4fe1\u53f7\u5f31\u6216\u5207\u6362\u57fa\u7ad9\u7b49\u539f\u56e0\uff0c\u4f60\u4f1a\u5f97\u5230\u4e00\u6761\u5145\u6ee1\u6bdb\u523a\u3001\u8df3\u8dc3\u751a\u81f3\u201c\u77ac\u79fb\u201d\u7684\u8f68\u8ff9\u3002\u76f4\u63a5\u5c06\u8fd9\u6837\u7684\u6570\u636e\u663e\u793a\u7ed9\u7528\u6237\uff0c\u4f53\u9a8c\u662f\u707e\u96be\u6027\u7684\u3002\u8f68\u8ff9\u4f18\u5316\uff0c\u5c31\u662f\u5c06\u8fd9\u6761\u201c\u91ce\u72d7\u201d\u822c\u7684\u539f\u59cb\u8f68\u8ff9\uff0c\u9a6f\u5316\u6210\u4e00\u6761\u5e73\u6ed1\u3001\u5408\u7406\u7684\u8def\u7ebf\u3002<\/p>\n<p><em>(\u6b64\u5904\u5e94\u914d\u4e00\u5f20\u539f\u59cb\u8f68\u8ff9\u5145\u6ee1\u6bdb\u523a\u548c\u8df3\u8dc3\u70b9\u7684\u201c\u574f\u201d\u8f68\u8ff9\u56fe)<\/em><\/p>\n<h3>\u5e38\u7528\u8f68\u8ff9\u5e73\u6ed1\u7b97\u6cd5\u7b80\u4ecb<\/h3>\n<p>\u5e73\u6ed1\u7b97\u6cd5\u7684\u6838\u5fc3\u601d\u60f3\u662f\uff0c\u57fa\u4e8e\u5386\u53f2\u70b9\u5bf9\u5f53\u524d\u70b9\u7684\u4f4d\u7f6e\u8fdb\u884c\u4fee\u6b63\u548c\u9884\u6d4b\u3002<\/p>\n<ul>\n<li><strong>\u6ed1\u52a8\u5e73\u5747\u6ee4\u6ce2<\/strong>\uff1a\u6700\u7b80\u5355\u7684\u4e00\u79cd\uff0c\u53d6\u6700\u8fd1N\u4e2a\u70b9\u7684\u5e73\u5747\u503c\u4f5c\u4e3a\u5f53\u524d\u70b9\u7684\u4f4d\u7f6e\u3002\u4f18\u70b9\u662f\u5b9e\u73b0\u7b80\u5355\uff0c\u7f3a\u70b9\u662f\u5e73\u6ed1\u6548\u679c\u4e00\u822c\uff0c\u4e14\u4f1a\u4ea7\u751f\u5ef6\u8fdf\u3002<\/li>\n<li><strong>\u5361\u5c14\u66fc\u6ee4\u6ce2 (Kalman Filter)<\/strong>\uff1a\u8fd9\u662f\u4e1a\u754c\u5904\u7406\u8f68\u8ff9\u3001\u5bfc\u822a\u7b49\u65f6\u5e8f\u6570\u636e\u7684\u4e3b\u6d41\u65b9\u6848\u3002\u5b83\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u9884\u6d4b-\u6821\u6b63\u6a21\u578b\uff0c\u80fd\u591f\u7ed3\u5408\u8fd0\u52a8\u72b6\u6001\uff08\u901f\u5ea6\u3001\u52a0\u901f\u5ea6\uff09\u6765\u9884\u6d4b\u4e0b\u4e00\u4e2a\u70b9\u7684\u4f4d\u7f6e\uff0c\u7136\u540e\u518d\u7528\u5b9e\u9645\u7684\u6d4b\u91cf\u503c\u6765\u4fee\u6b63\u8fd9\u4e2a\u9884\u6d4b\u3002\u5176\u6548\u679c\u8fdc\u8d85\u7b80\u5355\u7684\u5e73\u5747\u6ee4\u6ce2\uff0c\u80fd\u4ea7\u51fa\u975e\u5e38\u5e73\u6ed1\u4e14\u7b26\u5408\u8fd0\u52a8\u89c4\u5f8b\u7684\u8f68\u8ff9\u3002<\/li>\n<li><strong>\u9053\u683c\u62c9\u65af-\u666e\u514b (Douglas-Peucker) \u7b97\u6cd5<\/strong>\uff1a\u8fd9\u4e2a\u7b97\u6cd5\u4e3b\u8981\u7528\u4e8e\u8f68\u8ff9\u62bd\u7a00\uff0c\u800c\u975e\u5e73\u6ed1\u3002\u5b83\u80fd\u4ece\u4e00\u6761\u5bc6\u96c6\u7684\u8f68\u8ff9\u4e2d\uff0c\u5728\u4fdd\u8bc1\u6574\u4f53\u5f62\u72b6\u7684\u524d\u63d0\u4e0b\uff0c\u79fb\u9664\u5197\u4f59\u7684\u70b9\uff0c\u4ece\u800c\u6781\u5927\u51cf\u5c11\u5b58\u50a8\u548c\u4f20\u8f93\u7684\u6570\u636e\u91cf\u3002\u901a\u5e38\u5728\u5e73\u6ed1\u5904\u7406\u4e4b\u540e\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<h3>\u8f68\u8ff9\u7ea0\u504f\uff1a\u8ba9\u8f68\u8ff9\u201c\u8d34\u5408\u201d\u5728\u8def\u4e0a<\/h3>\n<p>\u8f68\u8ff9\u7ea0\u504f\uff0c\u901a\u5e38\u6307<strong>\u9053\u8def\u5438\u9644 (Map Matching)<\/strong> \u6280\u672f\u3002\u5b83\u7684\u4f5c\u7528\u662f\u5c06\u5e73\u6ed1\u540e\u7684\u8f68\u8ff9\u70b9\u201c\u62c9\u201d\u5230\u6700\u5339\u914d\u7684\u771f\u5b9e\u9053\u8def\u4e0a\u3002\u8fd9\u5bf9\u4e8e\u8f66\u8f86\u5bfc\u822a\u3001\u91cc\u7a0b\u8ba1\u7b97\u7b49\u573a\u666f\u81f3\u5173\u91cd\u8981\u3002\u81ea\u5df1\u5b9e\u73b0\u4e00\u5957\u9053\u8def\u5438\u9644\u7b97\u6cd5\u975e\u5e38\u590d\u6742\uff0c\u56e0\u4e3a\u5b83\u9700\u8981\u9ad8\u7cbe\u5ea6\u7684\u8def\u7f51\u6570\u636e\u3002\u5bf9\u4e8e\u7edd\u5927\u591a\u6570\u5f00\u53d1\u8005\u800c\u8a00\uff0c\u6700\u73b0\u5b9e\u7684\u505a\u6cd5\u662f\u8c03\u7528\u4e3b\u6d41\u5730\u56fe\u670d\u52a1\u5546\uff08\u5982\u9ad8\u5fb7\u3001\u767e\u5ea6\u3001Google Maps\uff09\u63d0\u4f9b\u7684\u8f68\u8ff9\u7ea0\u504fAPI\u63a5\u53e3\u3002<\/p>\n<p><em>(\u6b64\u5904\u5e94\u914d\u4e00\u5f20\u539f\u59cb\u8f68\u8ff9\u4e0e\u7ea0\u504f\u540e\u8f68\u8ff9\u7684\u5bf9\u6bd4\u56fe)<\/em><\/p>\n<h2>\u7b2c\u56db\u6b65\uff1a\u6570\u636e\u6301\u4e45\u5316\u4e0e\u5c55\u793a<\/h2>\n<h3>\u8f68\u8ff9\u6570\u636e\u5b58\u50a8\u65b9\u6848\uff1a\u672c\u5730\u8fd8\u662f\u4e91\u7aef\uff1f<\/h3>\n<ul>\n<li><strong>\u672c\u5730\u5b58\u50a8<\/strong>\uff1a\u4f7f\u7528SQLite\u3001Realm\u6216Core Data\u7b49\u79fb\u52a8\u7aef\u6570\u636e\u5e93\u3002\u8fd9\u975e\u5e38\u9002\u5408\u9700\u8981\u79bb\u7ebf\u4f7f\u7528\u3001\u6216\u8005\u4f5c\u4e3a\u6570\u636e\u4e0a\u4f20\u524d\u7684\u4e34\u65f6\u7f13\u5b58\u3002\u5b9e\u73b0\u7b80\u5355\uff0c\u54cd\u5e94\u8fc5\u901f\u3002<\/li>\n<li><strong>\u4e91\u7aef\u5b58\u50a8<\/strong>\uff1a\u5c06\u8f68\u8ff9\u70b9\u6279\u91cf\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u3002\u540e\u7aef\u901a\u5e38\u4f1a\u4f7f\u7528\u652f\u6301\u5730\u7406\u7a7a\u95f4\u6570\u636e\u5904\u7406\u7684\u6570\u636e\u5e93\uff08\u5982PostGIS\uff09\u8fdb\u884c\u5b58\u50a8\u548c\u5206\u6790\u3002\u5982\u679c\u4f60\u9700\u8981\u5b9e\u73b0\u8f68\u8ff9\u7684\u591a\u7aef\u540c\u6b65\u3001\u957f\u4e45\u4fdd\u5b58\u3001\u540e\u53f0\u8fdb\u884c\u91cc\u7a0b\u8ba1\u7b97\u6216\u5730\u7406\u56f4\u680f\u5206\u6790\u7b49\u9ad8\u7ea7\u529f\u80fd\uff0c\u90a3\u4e48\u4e91\u7aef\u5b58\u50a8\u662f\u5fc5\u987b\u7684\u3002<\/li>\n<\/ul>\n<p>\u4e00\u4e2a\u6210\u719f\u7684\u65b9\u6848\u901a\u5e38\u662f\u4e24\u8005\u7ed3\u5408\uff1a\u5728\u672c\u5730\u5b9e\u65f6\u5b58\u50a8\uff0c\u7136\u540e\u901a\u8fc7\u67d0\u79cd\u7b56\u7565\uff08\u5982\u5b9a\u65f6\u3001\u5b9a\u91cf\u3001Wi-Fi\u8fde\u63a5\u65f6\uff09\u5c06\u6570\u636e\u540c\u6b65\u5230\u4e91\u7aef\u3002<\/p>\n<h3>\u524d\u7aef\u5c55\u793a\uff1a\u5728\u5730\u56fe\u4e0a\u7ed8\u5236\u4f18\u7f8e\u7684\u8f68\u8ff9\u7ebf<\/h3>\n<p>\u8fd9\u901a\u5e38\u662f\u6574\u4e2a\u6d41\u7a0b\u4e2d\u6700\u76f4\u89c2\u7684\u4e00\u6b65\u3002\u4e3b\u6d41\u7684\u5730\u56feSDK\u90fd\u63d0\u4f9b\u4e86\u7ed8\u5236\u6298\u7ebf\uff08Polyline\u6216Overlay\uff09\u7684\u529f\u80fd\u3002\u4f60\u53ea\u9700\u8981\u5c06\u5904\u7406\u597d\u7684\u5750\u6807\u70b9\u5e8f\u5217\u4f20\u5165\u6307\u5b9a\u7684\u63a5\u53e3\u5373\u53ef\u3002<\/p>\n<p>\u4e3a\u4e86\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u4fe1\u606f\uff0c\u4f60\u8fd8\u53ef\u4ee5\u6839\u636e\u8f68\u8ff9\u70b9\u7684\u9644\u52a0\u4fe1\u606f\uff08\u5982\u901f\u5ea6\u3001\u6d77\u62d4\u3001\u65f6\u95f4\u6233\uff09\u5bf9\u8f68\u8ff9\u7ebf\u8fdb\u884c\u5206\u6bb5\u7740\u8272\u3002\u4f8b\u5982\uff0c\u901f\u5ea6\u5feb\u7684\u90e8\u5206\u663e\u793a\u4e3a\u7ea2\u8272\uff0c\u901f\u5ea6\u6162\u7684\u663e\u793a\u4e3a\u7eff\u8272\uff0c\u8fd9\u80fd\u8ba9\u7528\u6237\u5bf9\u81ea\u5df1\u7684\u8fd0\u52a8\u72b6\u6001\u4e00\u76ee\u4e86\u7136\u3002<\/p>\n<p><em>(\u6b64\u5904\u5e94\u914d\u4e00\u5f20\u5728\u5730\u56fe\u4e0a\u7ed8\u5236\u51fa\u5e73\u6ed1\u8f68\u8ff9\u7ebf\u7684App\u622a\u56fe)<\/em><\/p>\n<h2>\u7ec8\u6781\u4f18\u5316\uff1a\u6027\u80fd\u4e0e\u7535\u91cf\u6d88\u8017\u7ba1\u7406<\/h2>\n<p>\u4e00\u4e2a\u53ea\u987e\u5b9e\u73b0\u529f\u80fd\u800c\u4e0d\u987e\u6027\u80fd\u7684\u5f00\u53d1\u8005\uff0c\u4e0d\u662f\u4e00\u4e2a\u597d\u7684\u5f00\u53d1\u8005\u3002\u8f68\u8ff9\u8bb0\u5f55\u662f\u8017\u7535\u5927\u6237\uff0c\u6781\u81f4\u7684\u4f18\u5316\u662f\u4f53\u73b0\u4e13\u4e1a\u6027\u7684\u5730\u65b9\u3002<\/p>\n<h3>\u667a\u80fd\u8c03\u6574\u5b9a\u4f4d\u9891\u7387\u4e0e\u7cbe\u5ea6<\/h3>\n<p>\u6ca1\u6709\u5fc5\u8981\u59cb\u7ec8\u4fdd\u6301\u6700\u9ad8\u7cbe\u5ea6\u548c\u6700\u9ad8\u9891\u7387\u7684\u5b9a\u4f4d\u3002\u4f60\u53ef\u4ee5\u8bbe\u8ba1\u4e00\u5957\u52a8\u6001\u8c03\u6574\u7b56\u7565\uff1a<\/p>\n<ul>\n<li><strong>\u6839\u636e\u901f\u5ea6<\/strong>\uff1a\u5f53\u4f20\u611f\u5668\u68c0\u6d4b\u5230\u7528\u6237\u5728\u9ad8\u901f\u79fb\u52a8\uff08\u5982\u9a7e\u8f66\uff09\u65f6\uff0c\u63d0\u9ad8\u5b9a\u4f4d\u9891\u7387\uff1b\u5f53\u7528\u6237\u4f4e\u901f\u6216\u9759\u6b62\u65f6\uff0c\u5927\u5e45\u964d\u4f4e\u9891\u7387\uff0c\u751a\u81f3\u6682\u505c\u5b9a\u4f4d\u3002<\/li>\n<li><strong>\u6839\u636e\u4e1a\u52a1\u573a\u666f<\/strong>\uff1a\u5728\u9700\u8981\u7cbe\u786e\u8bb0\u5f55\u7684\u4e1a\u52a1\u6d41\u7a0b\uff08\u5982\u5f00\u59cb\u914d\u9001\uff09\u65f6\uff0c\u8bf7\u6c42\u9ad8\u7cbe\u5ea6\u5b9a\u4f4d\uff1b\u5728\u975e\u6838\u5fc3\u65f6\u6bb5\uff0c\u5207\u6362\u5230\u4f4e\u529f\u8017\u5b9a\u4f4d\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<h3>\u6279\u91cf\u4e0a\u4f20\u6570\u636e\uff0c\u51cf\u5c11\u7f51\u7edc\u8bf7\u6c42<\/h3>\n<p>\u5982\u679c\u9700\u8981\u5c06\u6570\u636e\u4e0a\u4f20\u5230\u4e91\u7aef\uff0c\u5207\u5fcc\u6bcf\u83b7\u53d6\u4e00\u4e2a\u70b9\u5c31\u53d1\u8d77\u4e00\u6b21\u7f51\u7edc\u8bf7\u6c42\u3002\u8fd9\u4f1a\u9891\u7e41\u5524\u9192\u7f51\u7edc\u6a21\u5757\uff0c\u9020\u6210\u5de8\u5927\u7684\u7535\u91cf\u6d88\u8017\u3002\u6b63\u786e\u7684\u505a\u6cd5\u662f\uff0c\u5c06\u5750\u6807\u70b9\u5148\u7f13\u5b58\u5728\u672c\u5730\u6570\u636e\u5e93\uff0c\u5f53\u6570\u636e\u91cf\u8fbe\u5230\u4e00\u5b9a\u9608\u503c\uff08\u5982100\u4e2a\u70b9\uff09\u6216\u8ddd\u79bb\u4e0a\u6b21\u4e0a\u4f20\u8d85\u8fc7\u4e00\u5b9a\u65f6\u95f4\uff08\u59825\u5206\u949f\uff09\u540e\uff0c\u518d\u5c06\u6570\u636e\u6253\u5305\u4e00\u6b21\u6027\u6279\u91cf\u4e0a\u4f20\u3002<\/p>\n<h3>\u5229\u7528\u8bbe\u5907\u72b6\u6001\uff08\u9759\u6b62\u3001\u79fb\u52a8\uff09\u4f18\u5316\u91c7\u96c6<\/h3>\n<p>\u7ed3\u5408\u52a0\u901f\u5ea6\u8ba1\u548c\u9640\u87ba\u4eea\u7b49\u4f4e\u529f\u8017\u4f20\u611f\u5668\uff0c\u53ef\u4ee5\u975e\u5e38\u7cbe\u786e\u5730\u5224\u65ad\u8bbe\u5907\u662f\u5904\u4e8e\u9759\u6b62\u3001\u6b65\u884c\u8fd8\u662f\u8f66\u8f7d\u72b6\u6001\u3002\u5f53\u68c0\u6d4b\u5230\u8bbe\u5907\u957f\u65f6\u95f4\u9759\u6b62\u65f6\uff0c\u5c31\u53ef\u4ee5\u5b8c\u5168\u6682\u505cGPS\u7684\u8bf7\u6c42\uff0c\u4ec5\u901a\u8fc7\u5176\u4ed6\u65b9\u5f0f\u201c\u76d1\u542c\u201d\u72b6\u6001\u53d8\u5316\uff0c\u5f85\u8bbe\u5907\u518d\u6b21\u79fb\u52a8\u65f6\u624d\u91cd\u65b0\u542f\u52a8\u9ad8\u7cbe\u5ea6\u5b9a\u4f4d\u3002\u8fd9\u662f\u6700\u9ad8\u7ea7\u7684\u7701\u7535\u7b56\u7565\u4e4b\u4e00\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u7b54 (FAQ)<\/h2>\n<h3>Q1: \u5982\u4f55\u6709\u6548\u5904\u7406GPS\u5b9a\u4f4d\u6f02\u79fb\uff0c\u5c24\u5176\u662f\u5728\u9ad8\u697c\u6797\u7acb\u7684\u57ce\u5e02\u5ce1\u8c37\u4e2d\uff1f<\/h3>\n<p>\u7b54\uff1a\u8fd9\u662f\u4e00\u4e2a\u7ec4\u5408\u62f3\u3002\u9996\u5148\uff0c\u5728\u91c7\u96c6\u5c42\u5c31\u8981\u505a\u8fc7\u6ee4\uff0c\u4e22\u5f03\u6389\u90a3\u4e9b <code>horizontalAccuracy<\/code> \uff08\u6c34\u5e73\u7cbe\u5ea6\u534a\u5f84\uff09\u8fc7\u5927\u7684\u70b9\u3002\u5176\u6b21\uff0c\u5728\u6570\u636e\u5904\u7406\u5c42\uff0c\u5fc5\u987b\u91c7\u7528\u5361\u5c14\u66fc\u6ee4\u6ce2\u8fd9\u7c7b\u66f4\u4f18\u7684\u5e73\u6ed1\u7b97\u6cd5\u8fdb\u884c\u6570\u636e\u540e\u5904\u7406\uff0c\u800c\u4e0d\u662f\u7b80\u5355\u7684\u5747\u503c\u6ee4\u6ce2\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u7684\u5e94\u7528\u573a\u666f\u662f\u8f66\u8f86\u6216\u884c\u4eba\u6cbf\u9053\u8def\u884c\u8fdb\uff0c\u5f3a\u70c8\u5efa\u8bae\u63a5\u5165\u5730\u56fe\u670d\u52a1\u5546\u7684\u9053\u8def\u5438\u9644API\u8fdb\u884c\u6700\u7ec8\u7684\u8f68\u8ff9\u7ea0\u504f\u3002<\/p>\n<h3>Q2: App\u5728\u540e\u53f0\u65f6\uff0c\u5982\u4f55\u4fdd\u8bc1\u8f68\u8ff9\u8bb0\u5f55\u4e0d\u4e2d\u65ad\uff08\u5982\u4f55\u4fdd\u6d3b\uff09\uff1f<\/h3>\n<p>\u7b54\uff1a\u5728Android\u4e0a\uff0c\u552f\u4e00\u53ef\u9760\u7684\u65b9\u5f0f\u662f\u4f7f\u7528\u524d\u53f0\u670d\u52a1\uff08Foreground Service\uff09\uff0c\u5e76\u4e3a\u5176\u914d\u5907\u4e00\u4e2a\u5bf9\u7528\u6237\u53ef\u89c1\u7684\u3001\u65e0\u6cd5\u8f7b\u6613\u5212\u6389\u7684\u5e38\u9a7b\u901a\u77e5\u3002\u8fd9\u662fGoogle\u5b98\u65b9\u6307\u5b9a\u7684\u540e\u53f0\u957f\u65f6\u4efb\u52a1\u6267\u884c\u65b9\u5f0f\u3002\u5728iOS\u4e0a\uff0c\u4f60\u5fc5\u987b\u5728\u9879\u76ee\u4e2d\u6b63\u786e\u914d\u7f6eBackground Modes\u4e2d\u7684Location updates\u80fd\u529b\uff0c\u5e76\u786e\u4fdd <code>allowsBackgroundLocationUpdates<\/code> \u5c5e\u6027\u4e3a <code>true<\/code>\u3002\u540c\u65f6\uff0c\u8981\u6839\u636e\u573a\u666f\u51b3\u5b9a\u662f\u5426\u5173\u95ed <code>pausesLocationUpdatesAutomatically<\/code>\u3002<\/p>\n<h3>Q3: \u5982\u4f55\u5728\u4fdd\u8bc1\u8f68\u8ff9\u7cbe\u5ea6\u7684\u540c\u65f6\uff0c\u6700\u5927\u9650\u5ea6\u5730\u8282\u7701\u7535\u91cf\uff1f<\/h3>\n<p>\u7b54\uff1a\u6838\u5fc3\u601d\u60f3\u662f\u201c\u6309\u9700\u7d22\u53d6\uff0c\u667a\u80fd\u542f\u505c\u201d\u30021. \u4f18\u5148\u4f7f\u7528\u878d\u5408\u5b9a\u4f4d\uff0c\u800c\u4e0d\u662f\u5f3a\u884c\u53ea\u7528GPS\u30022. \u6839\u636e\u7528\u6237\u7684\u79fb\u52a8\u901f\u5ea6\u548c\u5f53\u524d\u4e1a\u52a1\u573a\u666f\uff0c\u52a8\u6001\u8c03\u6574\u5b9a\u4f4d\u7684\u9891\u7387\uff08<code>interval<\/code>\uff09\u548c\u7cbe\u5ea6\uff08<code>priority<\/code>\/<code>desiredAccuracy<\/code>\uff09\u30023. \u5229\u7528\u52a0\u901f\u5ea6\u8ba1\u7b49\u4f4e\u529f\u8017\u4f20\u611f\u5668\u5224\u65ad\u7528\u6237\u662f\u5426\u9759\u6b62\uff0c\u5e76\u5728\u9759\u6b62\u65f6\u6682\u505cGPS\u8bf7\u6c42\u30024. \u91c7\u7528\u6279\u91cf\u4e0a\u4f20\u7b56\u7565\uff0c\u51cf\u5c11\u7f51\u7edc\u6a21\u5757\u7684\u5524\u9192\u6b21\u6570\u3002<\/p>\n<h3>Q4: \u8f68\u8ff9\u6570\u636e\u5e94\u8be5\u5b58\u50a8\u5728\u672c\u5730\u8fd8\u662f\u670d\u52a1\u5668\uff1f<\/h3>\n<p>\u7b54\uff1a\u8fd9\u5b8c\u5168\u53d6\u51b3\u4e8e\u4f60\u7684\u4e1a\u52a1\u9700\u6c42\u3002\u5982\u679c\u8f68\u8ff9\u4ec5\u7528\u4e8e\u5355\u6b21\u3001\u4e34\u65f6\u7684\u8bb0\u5f55\u548c\u5c55\u793a\uff08\u5982\u4e00\u6b21\u8dd1\u6b65\u8bb0\u5f55\uff09\uff0c\u5b58\u50a8\u5728\u672c\u5730\u5b8c\u5168\u8db3\u591f\u3002\u4f46\u5982\u679c\u9700\u8981\u8de8\u8bbe\u5907\u540c\u6b65\uff08\u5728\u624b\u673a\u548c\u7535\u8111\u4e0a\u90fd\u80fd\u770b\uff09\u3001\u957f\u671f\u5386\u53f2\u8ffd\u6eaf\u3001\u6216\u5728\u540e\u7aef\u8fdb\u884c\u590d\u6742\u7684\u5730\u7406\u7a7a\u95f4\u5206\u6790\uff08\u5982\u8ba1\u7b97\u603b\u91cc\u7a0b\u3001\u5206\u6790\u5e38\u53bb\u5730\u70b9\uff09\uff0c\u90a3\u4e48\u5c31\u5fc5\u987b\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u3002\u4e1a\u754c\u7684\u6700\u4f73\u5b9e\u8df5\u901a\u5e38\u662f\u201c\u672c\u5730\u7f13\u5b58+\u4e91\u7aef\u540c\u6b65\u201d\u7684\u6df7\u5408\u6a21\u5f0f\u3002<\/p>\n<h3>Q5: \u6211\u5e94\u8be5\u9009\u62e9\u539f\u751f\u5b9a\u4f4dAPI\u8fd8\u662f\u7b2c\u4e09\u65b9\u5730\u56feSDK\uff1f<\/h3>\n<p>\u7b54\uff1a\u5982\u679c\u4f60\u7684\u6838\u5fc3\u9700\u6c42\u5c31\u662f\u83b7\u53d6\u548c\u8bb0\u5f55\u5750\u6807\u70b9\uff0c\u5e76\u4e14\u5e0c\u671b\u5bf9\u5b9a\u4f4d\u53c2\u6570\u6709\u6700\u7cbe\u7ec6\u7684\u63a7\u5236\uff0c\u6216\u8005\u60f3\u4fdd\u6301App\u7684\u8f7b\u91cf\u5316\uff0c\u90a3\u4e48\u539f\u751fAPI\uff08Android <code>FusedLocationProviderClient<\/code> \/ iOS <code>CLLocationManager<\/code>\uff09\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002\u5982\u679c\u4f60\u9700\u8981\u590d\u6742\u7684\u5730\u56fe\u4ea4\u4e92\u3001POI\u641c\u7d22\u3001\u8def\u5f84\u89c4\u5212\uff0c\u5c24\u5176\u662f\u5f00\u7bb1\u5373\u7528\u7684\u8f68\u8ff9\u7ea0\u504f\u3001\u9053\u8def\u5438\u9644\u7b49\u9ad8\u7ea7\u529f\u80fd\uff0c\u90a3\u4e48\u96c6\u6210\u7b2c\u4e09\u65b9\u5730\u56feSDK\uff08\u5982\u9ad8\u5fb7\u3001\u767e\u5ea6\u3001Google\uff09\u4f1a\u6781\u5927\u5730\u63d0\u5347\u4f60\u7684\u5f00\u53d1\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u4e60\u5982\u4f55\u5728\u79fb\u52a8\u5e94\u7528\u4e2d\u5b9e\u73b0\u9ad8\u6548\u3001\u4f4e\u8017\u7684\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u3002\u672c\u6587\u63d0\u4f9bAndroid\u548ciOS\u5e73\u53f0\u7684\u5b8c\u6574\u5b9e\u73b0\u6307\u5357\uff0c\u5305\u62ec\u6743\u9650\u914d\u7f6e\u3001\u6570\u636e\u91c7\u96c6\u3001\u8f68\u8ff9\u4f18\u5316\u3001\u6301\u4e45\u5316\u5b58\u50a8\u53ca\u6027\u80fd\u4f18\u5316\u7b56\u7565\u3002\u638c\u63e1\u6784\u5efa\u5de5\u4e1a\u7ea7\u8f68\u8ff9\u8bb0\u5f55\u7cfb\u7edf\u7684\u5173\u952e\u6280\u672f\u3002<\/p>\n","protected":false},"author":1,"featured_media":5529,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[],"class_list":["post-5530","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zhishi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4 - \u5c0f\u6b65\u5916\u52e4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4 - \u5c0f\u6b65\u5916\u52e4\" \/>\n<meta property=\"og:description\" content=\"\u5b66\u4e60\u5982\u4f55\u5728\u79fb\u52a8\u5e94\u7528\u4e2d\u5b9e\u73b0\u9ad8\u6548\u3001\u4f4e\u8017\u7684\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u3002\u672c\u6587\u63d0\u4f9bAndroid\u548ciOS\u5e73\u53f0\u7684\u5b8c\u6574\u5b9e\u73b0\u6307\u5357\uff0c\u5305\u62ec\u6743\u9650\u914d\u7f6e\u3001\u6570\u636e\u91c7\u96c6\u3001\u8f68\u8ff9\u4f18\u5316\u3001\u6301\u4e45\u5316\u5b58\u50a8\u53ca\u6027\u80fd\u4f18\u5316\u7b56\u7565\u3002\u638c\u63e1\u6784\u5efa\u5de5\u4e1a\u7ea7\u8f68\u8ff9\u8bb0\u5f55\u7cfb\u7edf\u7684\u5173\u952e\u6280\u672f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps\" \/>\n<meta property=\"og:site_name\" content=\"\u5c0f\u6b65\u5916\u52e4\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-25T14:35:04+00:00\" \/>\n<meta name=\"author\" content=\"xiaobuwaiqin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"xiaobuwaiqin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps\"},\"author\":{\"name\":\"xiaobuwaiqin\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/person\/95f6ab0761d387b565037696ceb3a5df\"},\"headline\":\"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4\",\"datePublished\":\"2026-02-25T14:35:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps\"},\"wordCount\":135,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg\",\"articleSection\":[\"\u767e\u79d1\u77e5\u8bc6\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps\",\"url\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps\",\"name\":\"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4 - \u5c0f\u6b65\u5916\u52e4\",\"isPartOf\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg\",\"datePublished\":\"2026-02-25T14:35:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage\",\"url\":\"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg\",\"contentUrl\":\"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg\",\"width\":1280,\"height\":720,\"caption\":\"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.xiaobuwq.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#website\",\"url\":\"https:\/\/www.xiaobuwq.com\/blog\/\",\"name\":\"\u5c0f\u6b65\u5916\u52e4\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.xiaobuwq.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#organization\",\"name\":\"\u5c0f\u6b65\u5916\u52e4\",\"url\":\"https:\/\/www.xiaobuwq.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2025\/11\/logo.png\",\"contentUrl\":\"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2025\/11\/logo.png\",\"width\":1200,\"height\":303,\"caption\":\"\u5c0f\u6b65\u5916\u52e4\"},\"image\":{\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/person\/95f6ab0761d387b565037696ceb3a5df\",\"name\":\"xiaobuwaiqin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32cb7a890d7fe030c6ceb7dda1ee2a52d5cfbecf4cfea259e2d9b62ac6d32083?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32cb7a890d7fe030c6ceb7dda1ee2a52d5cfbecf4cfea259e2d9b62ac6d32083?s=96&d=mm&r=g\",\"caption\":\"xiaobuwaiqin\"},\"sameAs\":[\"https:\/\/www.xiaobuwq.com\/blog\"],\"url\":\"https:\/\/www.xiaobuwq.com\/blog\/author\/xiaobuwaiqin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4 - \u5c0f\u6b65\u5916\u52e4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps","og_locale":"zh_CN","og_type":"article","og_title":"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4 - \u5c0f\u6b65\u5916\u52e4","og_description":"\u5b66\u4e60\u5982\u4f55\u5728\u79fb\u52a8\u5e94\u7528\u4e2d\u5b9e\u73b0\u9ad8\u6548\u3001\u4f4e\u8017\u7684\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u3002\u672c\u6587\u63d0\u4f9bAndroid\u548ciOS\u5e73\u53f0\u7684\u5b8c\u6574\u5b9e\u73b0\u6307\u5357\uff0c\u5305\u62ec\u6743\u9650\u914d\u7f6e\u3001\u6570\u636e\u91c7\u96c6\u3001\u8f68\u8ff9\u4f18\u5316\u3001\u6301\u4e45\u5316\u5b58\u50a8\u53ca\u6027\u80fd\u4f18\u5316\u7b56\u7565\u3002\u638c\u63e1\u6784\u5efa\u5de5\u4e1a\u7ea7\u8f68\u8ff9\u8bb0\u5f55\u7cfb\u7edf\u7684\u5173\u952e\u6280\u672f\u3002","og_url":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps","og_site_name":"\u5c0f\u6b65\u5916\u52e4","article_published_time":"2026-02-25T14:35:04+00:00","author":"xiaobuwaiqin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"xiaobuwaiqin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#article","isPartOf":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps"},"author":{"name":"xiaobuwaiqin","@id":"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/person\/95f6ab0761d387b565037696ceb3a5df"},"headline":"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4","datePublished":"2026-02-25T14:35:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps"},"wordCount":135,"commentCount":0,"publisher":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage"},"thumbnailUrl":"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg","articleSection":["\u767e\u79d1\u77e5\u8bc6"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps","url":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps","name":"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4 - \u5c0f\u6b65\u5916\u52e4","isPartOf":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage"},"image":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage"},"thumbnailUrl":"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg","datePublished":"2026-02-25T14:35:04+00:00","breadcrumb":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#primaryimage","url":"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg","contentUrl":"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2026\/02\/09aa55fb2b889cfdac2cfa344a60708e.jpeg","width":1280,"height":720,"caption":"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4"},{"@type":"BreadcrumbList","@id":"https:\/\/www.xiaobuwq.com\/blog\/trajectory-recording-function-implementation-steps#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.xiaobuwq.com\/blog\/"},{"@type":"ListItem","position":2,"name":"\u8f68\u8ff9\u8bb0\u5f55\u529f\u80fd\u5728\u8f6f\u4ef6\u4e2d\u7684\u5b9e\u73b0\u65b9\u6cd5\u4e0e\u6b65\u9aa4"}]},{"@type":"WebSite","@id":"https:\/\/www.xiaobuwq.com\/blog\/#website","url":"https:\/\/www.xiaobuwq.com\/blog\/","name":"\u5c0f\u6b65\u5916\u52e4","description":"","publisher":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.xiaobuwq.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/www.xiaobuwq.com\/blog\/#organization","name":"\u5c0f\u6b65\u5916\u52e4","url":"https:\/\/www.xiaobuwq.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2025\/11\/logo.png","contentUrl":"https:\/\/www.xiaobuwq.com\/blog\/wp-content\/uploads\/2025\/11\/logo.png","width":1200,"height":303,"caption":"\u5c0f\u6b65\u5916\u52e4"},"image":{"@id":"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/person\/95f6ab0761d387b565037696ceb3a5df","name":"xiaobuwaiqin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.xiaobuwq.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32cb7a890d7fe030c6ceb7dda1ee2a52d5cfbecf4cfea259e2d9b62ac6d32083?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32cb7a890d7fe030c6ceb7dda1ee2a52d5cfbecf4cfea259e2d9b62ac6d32083?s=96&d=mm&r=g","caption":"xiaobuwaiqin"},"sameAs":["https:\/\/www.xiaobuwq.com\/blog"],"url":"https:\/\/www.xiaobuwq.com\/blog\/author\/xiaobuwaiqin"}]}},"views":182,"_links":{"self":[{"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/posts\/5530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/comments?post=5530"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/posts\/5530\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/media\/5529"}],"wp:attachment":[{"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/media?parent=5530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/categories?post=5530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobuwq.com\/blog\/wp-json\/wp\/v2\/tags?post=5530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}