\u81ea\u5df1\u505aAPP<\/a>atitude”\u548c”Sensors.Longitude”\uff0c\u5c06\u5b83\u4eec\u62d6\u5230\u5e94\u7528\u7a0b\u5e8f\u7684\u4e3b\u754c\u9762\u4e2d\uff0c\u5e76\u8fde\u63a5\u5b83\u4eec\u5230”Latitude”\u548c”Longitude”\u53d8\u91cf\u4e0a\u3002<\/p>\n\u63a5\u4e0b\u6765\uff0c\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a\u201c\u6309\u952e\u201d\u9879\u7528\u4e8e\u542f\u52a8\u83b7\u53d6\u5929\u6c14\u4fe1\u606f\u7684\u811a\u672c\u3002\u5728 “User Interface” \u680f\u4e2d\u627e\u5230 “Button”\uff0c\u5c06\u5176\u62d6\u5230\u5e94\u7528\u7a0b\u5e8f\u7684\u4e3b\u754c\u9762\u4e0a\uff0c\u5c06\u5176\u547d\u540d\u4e3a\u201cGet Weather\u201d\uff0c\u7136\u540e\u5728\u811a\u672c\u90e8\u5206\u4e2d\u4e3a\u5176\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n
1.\u6fc0\u6d3b\u83b7\u53d6\u4f4d\u7f6e\u67e5\u627e\u7ef4\u5ea6\u548c\u7ecf\u5ea6\u7684\u53d8\u91cf;<\/p>\n
2.\u5c06\u7ef4\u5ea6\u548c\u7ecf\u5ea6\u53d8\u91cf\u8fde\u63a5\u5230 API \u4e0a;<\/p>\n
3.\u4f7f\u7528 API \u6765\u68c0\u7d22\u533a\u57df\u5929\u6c14\u4fe1\u606f\uff0c\u5c06\u83b7\u53d6\u7684\u4fe1\u606f\u663e\u793a\u5728\u5e94\u7528\u7a0b\u5e8f\u7684\u5c4f\u5e55\u4e0a;<\/p>\n
\u8fd9\u662f\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u6765\u5b9e\u73b0\u7684\uff1a<\/p>\n
1. call LocationSensor1.StartListening\uff08\uff09;<\/p>\n
2. Web1.Url = “https:\/\/api.openweathermap.org\/data\/2.5\/weather?lat=”&Latitude&”&lon=”&Longitude&”&appid={YOUR-APPID}”;<\/p>\n
3. decode the JSON response from the API and display the relevant information on the screen.<\/p>\n
\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u9700\u8981\u4f7f\u7528OpenWeatherMap API\u6765\u83b7\u53d6\u5929\u6c14\u4fe1\u606f\uff0c\u9700\u8981\u53bb\u8be5\u7f51\u7ad9\u6ce8\u518c\u5e76\u83b7\u53d6\u60a8\u7684API\u5bc6\u94a5\u3002<\/p>\n
\u6700\u540e\uff0c\u53ef\u4ee5\u5c06\u5e94\u7528\u7a0b\u5e8f\u754c\u9762\u8fdb\u884c\u4f18\u5316\u548c\u7f8e\u5316\uff0c\u5305\u62ec\u6dfb\u52a0\u6807\u7b7e\u3001\u6dfb\u52a0\u56fe\u7247\u3001\u6dfb\u52a0\u80cc\u666f\u548c\u6dfb\u52a0\u5176\u4ed6\u56fe\u5f62\u7b49\u3002\u5b8c\u6210\u540e\uff0c\u901a\u8fc7\u626b\u63cf\u4e8c\u7ef4\u7801\uff0c\u53ef\u4ee5\u5c06\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u5b89\u88c5\u5230Android\u8bbe\u5907\u4e0a\u8fdb\u884c\u4f7f\u7528\u3002<\/p>\n
\u603b\u4e4b\uff0c\u5236\u4f5c\u81ea\u5df1\u7684\u5e94\u7528\u7a0b\u5e8f\u5e76\u4e0d\u662f\u4e00\u4ef6\u96be\u4e8b\uff0c\u53ea\u9700\u8981\u4f7f\u7528\u7c7b\u4f3cMIT App Inventor\u8fd9\u6837\u7684\u5728\u7ebf\u5e73\u53f0\uff0c\u901a\u8fc7\u7b80\u5355\u7684\u62d6\u62fd\u548c\u8fde\u63a5\u5757\u6765\u521b\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u65e0\u8bba\u662f\u5728\u5e94\u7528\u7a0b\u5e8f\u754c\u9762\u8fd8\u662f\u5728\u811a\u672c\u90e8\u5206\uff0c\u90fd\u9700\u8981\u6709\u4e00\u5b9a\u7684\u8bbe\u8ba1\u548c\u4ee3\u7801\u6280\u80fd\u6765\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u7684\u6709\u6548\u6027\u548c\u6d41\u7545\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5236\u4f5c\u4e00\u4e2a\u81ea\u5df1\u9700\u8981\u7684app\u53ef\u4ee5\u8ba9\u6211\u4eec\u66f4\u597d\u5730\u7ba1\u7406\u6211\u4eec\u7684\u751f\u6d3b\u548c\u5de5\u4f5c\uff0c\u73b0\u5728\u5df2\u7ecf\u6709\u5f88\u591a\u7684\u5728\u7ebf\u5e73\u53f0\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5b9e\u73b0\u8fd9\u4e2a\u76ee\u6807\uff0c\u6bd4\u5982\u5236\u4f5cAndroid APP\u7684MIT App Inventor\u3002MIT App In<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[21492,116,10138,358,21491],"topic":[],"class_list":["post-19224","post","type-post","status-publish","format-standard","hentry","category-appfenfa","tag-21492","tag-116","tag-app","tag-358"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/19224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=19224"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/19224\/revisions"}],"predecessor-version":[{"id":19269,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/19224\/revisions\/19269"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=19224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=19224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=19224"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=19224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}