{"id":7139,"date":"2015-05-11T15:30:41","date_gmt":"2015-05-11T06:30:41","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=7139"},"modified":"2015-05-11T15:31:53","modified_gmt":"2015-05-11T06:31:53","slug":"win-iot-on-rpi-%e3%81%a7-webview-%e3%82%92%e8%a9%a6%e3%81%99","status":"publish","type":"post","link":"https:\/\/www.moonmile.net\/blog\/archives\/7139","title":{"rendered":"Win IoT on RPi \u3067 WebView \u3092\u8a66\u3059"},"content":{"rendered":"<p>\u57fa\u672c\u3001\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u8c4a\u5bcc\u306a UI \u306f\u5fc5\u8981\u306a\u3044\u2026\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001Win IoT Core \u306b\u306f WebView \u3068\u3044\u3046\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002WebView \u81ea\u4f53\u306f\u30b9\u30c8\u30a2\u30a2\u30d7\u30ea\u306b\u3082\u3042\u308b\u306e\u3067\u3001\u3069\u308c\u3060\u3051\u8868\u793a\u3055\u308c\u308b\u304b\u306f IoT Core \u306e\u5b9f\u88c5\u6b21\u7b2c\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u304c\u3001RPi2 \u306e\u5834\u5408\u306f\u305d\u308c\u306a\u308a\u306b GPU \u304c\u4f7f\u3048\u308b\uff08\u63cf\u753b\u306e\u9ad8\u901f\u5316\u3082\u58f2\u308a\u306b\u3057\u3066\u3044\u308b\uff09\u306e\u3067\u3001\u624b\u8efd\u306b\u753b\u50cf\u3084\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3055\u305b\u308b\u305f\u3081\u306e WebView \u306b\u3082\u671f\u5f85\u3057\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u3002\u305f\u3076\u3093\u3001DOM \u89e3\u6790\u3082\u3067\u304d\u308b\u304b\u3089 HTML \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u3066\u30d1\u30fc\u30b9\u3057\u305f\u308a\u3001\u9006\u306b\u30ea\u30bd\u30fc\u30b9\u306b\u542b\u3081\u3066\u3042\u308b HTML \u3092\u8aad\u307f\u3060\u3057\u3066 jQuery \u3067\u5236\u5fa1\u3059\u308b\u3068\u3044\u3046\u6280\u3082\u53ef\u80fd\u306a\u306f\u305a\u3067\u3059\u3002<\/p>\n<h2>\u5b9f\u9a13\u7528\u30a2\u30d7\u30ea<\/h2>\n<p>WebView \u3092\u8cbc\u308a\u4ed8\u3051\u305f\u7c21\u5358\u306a\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u304a\u304d\u307e\u3059\u3002\u79c1\u306e RPi \u306e\u5834\u5408\u3001USB \u30de\u30a6\u30b9\/\u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u4e21\u65b9\u3068\u3082\u52b9\u304b\u306a\u3044\u3067\u3001PC \u304b\u3089 URL \u3092\u9001\u308b\u4ed5\u7d44\u307f\u3092\u4f5c\u3063\u3066\u304a\u304d\u307e\u3059\u3002\u5148\u65e5\u4f5c\u3063\u305f SimpleWebServer \u3092\u5229\u7528\u3057\u3066\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\npublic sealed partial class MainPage : Page\r\n{\r\n    public MainPage()\r\n    {\r\n        this.InitializeComponent();\r\n        this.Loaded += MainPage_Loaded;\r\n    }\r\n\r\n    SimpleWebServer _server;\r\n    private void MainPage_Loaded(object sender, RoutedEventArgs e)\r\n    {\r\n        _server = new SimpleWebServer();\r\n        _server.OnReceived += _server_OnReceived;\r\n        _server.Start();\r\n        \/\/ this.webView.Navigate(new Uri(textUrl.Text));\r\n    }\r\n\r\n    private async void _server_OnReceived(string data)\r\n    {\r\n        var url = data.Substring(1);    \/\/ \u6700\u521d\u306e &amp;quot;\/&amp;quot; \u306e\u307f\u6d88\u3059\r\n        \/\/ GET \u53d7\u4fe1\r\n        await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,\r\n            () =&gt; {\r\n                textUrl.Text = url;\r\n                this.webView.Navigate(new Uri(url));\r\n\r\n            });\r\n        \/\/ \u5fdc\u7b54\u3092\u9001\u4fe1\r\n        _server.SendResponse(&amp;quot;response: &amp;quot; + data);\r\n    }\r\n}\r\n<\/pre>\n<p>\u3053\u3093\u306a\u98a8\u306b\u9001\u3089\u308c\u3066\u304d\u305f\u30c7\u30fc\u30bf\u3092\u3001WebView.Navigate \u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<h2>\u3044\u308d\u3044\u308d\u52d5\u304b\u3057\u3066\u307f\u308b<\/h2>\n<p>\u30ce\u30fc\u30de\u30eb\u306b\u81ea\u5206\u306e wordpress \u306e\u30b5\u30a4\u30c8\u3092\u8868\u793a\u3055\u305b\u307e\u3059\u3002User Agenet \u304c\u30e2\u30d0\u30a4\u30eb\u306b\u306a\u3063\u3066\u3044\u308b\u3089\u3057\u304f\u3001\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306e\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u3001WebView \u306e\u307b\u3046\u3067\u6307\u5b9a\u304c\u53ef\u80fd\u306a\u306f\u305a\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pbs.twimg.com\/media\/CEso-6tUEAAJYKr.jpg\" alt=\"https:\/\/pbs.twimg.com\/media\/CEso-6tUEAAJYKr.jpg\" \/><\/p>\n<p>\u91cd\u305f\u305d\u3046\u306a microsoft.com \u3092\u8868\u793a\u3055\u305b\u307e\u3059\u3002\u4e2d\u592e\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u51fa\u3066\u304d\u305f\u3068\u3053\u308d\u3092\u898b\u308b\u3068\u3001Javascript \u304c\u52d5\u3044\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u306d\u3002\u3061\u306a\u307f\u306b\u3001\u30de\u30a6\u30b9\u304c\u52d5\u304b\u306a\u3044\u306e\u3067\u3001\u3053\u308c\u4ee5\u4e0a\u9032\u3081\u307e\u305b\u3093\u304c\uff08\u82e6\u7b11\uff09\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pbs.twimg.com\/media\/CEso-5SUsAEIDdM.jpg\" alt=\"https:\/\/pbs.twimg.com\/media\/CEso-5SUsAEIDdM.jpg\" \/><\/p>\n<p>\u3069\u3046\u305b\u306a\u306e\u3067\u3001Raspberrypi.org \u3082\u8868\u793a\u3055\u305b\u307e\u3059\u3002\u30ec\u30a4\u30a2\u30a6\u30c8\u5d29\u308c\u3082\u306a\u3044\u306e\u3067\u3001CSS \u304c\u304d\u3061\u3093\u3068\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pbs.twimg.com\/media\/CEsqnvNVAAAeonC.jpg:large\" alt=\"https:\/\/pbs.twimg.com\/media\/CEsqnvNVAAAeonC.jpg:large\" width=\"605\" height=\"452\" \/><\/p>\n<p>twitter.com \u3082\u8868\u793a\u3067\u304d\u307e\u3059\u3002\u30ad\u30fc\u30dc\u30fc\u30c9\u304c\u7121\u53cd\u5fdc\u306a\u306e\u3067\u3001\u6295\u7a3f\u3068\u304b\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u30bf\u30a4\u30e0\u30e9\u30a4\u30f3\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3068\u3053\u308d\u3092\u307f\u308b\u3068\u3001Twitter API \u304c\u304d\u3061\u3093\u3068\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002Win IoT \u306f SSL\/TLS \u5bfe\u5fdc\u306a\u306e\u3067 https \u3082\u901a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pbs.twimg.com\/media\/CEssUhTUUAAkmqq.jpg:large\" alt=\"https:\/\/pbs.twimg.com\/media\/CEssUhTUUAAkmqq.jpg:large\" width=\"611\" height=\"456\" \/><\/p>\n<p>\u3061\u3087\u3063\u3068\u8907\u96d1\u306a\u3068\u3053\u308d\u3067\u3001<a href=\"http:\/\/liginc.co.jp\/web\/js\/jquery\/97697\">SVG\u3068jQuery\u3067\u7d75\u3092\u63cf\u3044\u3066\u3044\u308b\u3088\u3046\u306a\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5 | \u682a\u5f0f\u4f1a\u793eLIG<\/a> \u306b\u3042\u308b SVG + jQuery \u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u8868\u793a\u3055\u305b\u307e\u3059\u3002\u3048\u3089\u304f\u9045\u3044\u3067\u3059\u304c\u3001\u304d\u308c\u3044\u306b SVG \u3068 jQuery \u304c\u52d5\u304d\u307e\u3059\u3002\u3053\u308c\u3060\u3051\u52d5\u3051\u3070\u3001\u305f\u3044\u3066\u3044\u306e\u30b5\u30a4\u30c8\u306f\u8868\u793a\u3067\u304d\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pbs.twimg.com\/media\/CEst9ZLUsAAwL8I.jpg:large\" alt=\"https:\/\/pbs.twimg.com\/media\/CEst9ZLUsAAwL8I.jpg:large\" width=\"609\" height=\"455\" \/><\/p>\n<p>Youtube \u306f HTML5 \u30e2\u30fc\u30c9\u3067\u52d5\u3044\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u52d5\u753b\u304c\u518d\u751f\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u306f\u4e0d\u660e\u306a\u306e\u3067\u3059\u304c\uff08\u3042\u3061\u3053\u3061\u306e\u30b5\u30a4\u30c8\u3092\u63a2\u3057\u305f\u3051\u3069\u3001\u81ea\u52d5\u518d\u751f\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u3067\u3057\u305f\uff09\u3001\u307e\u3042\u3001\u5927\u4e08\u592b\u306a\u306e\u3067\u306f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pbs.twimg.com\/media\/CEswOxWUMAAQKkL.jpg:large\" alt=\"https:\/\/pbs.twimg.com\/media\/CEswOxWUMAAQKkL.jpg:large\" width=\"613\" height=\"458\" \/><\/p>\n<p>\u5b9f\u9a13\u7684\u306b mpeg \u52d5\u753b\u3092\u81ea\u30b5\u30a4\u30c8\u306b\u30a2\u30c3\u30d7\u3057\u3066\u8868\u793a\u3055\u305b\u308b\u3068\u3001\u3046\u307e\u304f\u52d5\u304d\u307e\u3059\u3002\u8aad\u307f\u8fbc\u307f\u306b\u5c11\u3005\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u304c\u3001\u304d\u308c\u3044\u306b\u52d5\u304d\u3066\u3044\u308b\u306e\u3067\u3053\u308c\u3067\u5341\u5206\u304b\u3068\u3002\u97f3\u58f0\u304c\u51fa\u306a\u304b\u3063\u305f\u306e\u306f\u30014\u7dda\u30d7\u30e9\u30b0\u306e\u307b\u3046\u3067\u51fa\u3066\u3044\u308b\u306e\u304b\u3001HDMI \u306e\u97f3\u58f0\u51fa\u529b\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u306e\u304b\u306f\u4e0d\u660e\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pbs.twimg.com\/media\/CEs0IdqUsAAjr6n.jpg:large\" alt=\"https:\/\/pbs.twimg.com\/media\/CEs0IdqUsAAjr6n.jpg:large\" width=\"617\" height=\"461\" \/><\/p>\n<p>\u3053\u308c\u3089\u306f\u3001WebView \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u5185\u3067\u8868\u793a\u3055\u305b\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001XAML \u5185\u306b\u9069\u5f53\u306a\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\uff08\u30e1\u30c7\u30a3\u30a2\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306a\u3069\uff09\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u3082\u52d5\u304f\u3068\u601d\u3044\u307e\u3059\u3002Flash \u3068\u304b ogg \u306f\u7121\u7406\u305d\u3046\u306a\u306e\u3067\u3001\u305d\u306e\u3042\u305f\u308a\u306f\u4eca\u5f8c\u306e OSS \u7cfb\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u671f\u5f85\u3067\u3059\u3002C++\/CX \u304c\u4f7f\u3048\u308b\u306e\u3067\u3001\u30c7\u30b3\u30fc\u30c9\u95a2\u4fc2\u306e\u3082\u306e\u3092\u6301\u3063\u3066\u304f\u308c\u3070\u52d5\u304f\u3093\u3058\u3083\u306a\u3044\u3067\u3059\u304b\u306d\u3002\u3061\u306a\u307f\u306b\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f Universal \u3067\u4f5c\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u306e\u307e\u307e Windows Phone \u3084 PC \u3067\u3082\u52d5\u4f5c\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u306e\u5b9f\u9a13\u30d7\u30ed\u30b0\u30e9\u30e0\u81ea\u4f53\u3082\u3001\u4e00\u5ea6 PC \u4e0a\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u304b\u3089 RPi2 \u3067\u52d5\u304b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u672c\u3001\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u8c4a\u5bcc\u306a UI \u306f\u5fc5\u8981\u306a\u3044\u2026\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001Win IoT Core \u306b\u306f WebView \u3068\u3044\u3046\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002WebView \u81ea\u4f53\u306f\u30b9\u30c8\u30a2\u30a2\u30d7\u30ea\u306b\u3082\u3042\u308b\u306e\u3067\u3001\u3069\u308c\u3060\u3051\u8868\u793a\u3055\u308c\u308b\u304b\u306f IoT &hellip; <a href=\"https:\/\/www.moonmile.net\/blog\/archives\/7139\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[67,77],"tags":[],"class_list":["post-7139","post","type-post","status-publish","format-standard","hentry","category-raspberrypi","category-win-iot"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/7139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=7139"}],"version-history":[{"count":2,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/7139\/revisions"}],"predecessor-version":[{"id":7141,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/7139\/revisions\/7141"}],"wp:attachment":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=7139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=7139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=7139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}