Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AndroidにおけるWebの進化

 AndroidにおけるWebの進化

Mikami Hiroki

June 21, 2023
Tweet

More Decks by Mikami Hiroki

Other Decks in Programming

Transcript

  1. AndroidにおけるWebコンテンツ • AndroidにおけるWebコンテンツの扱いは主に4つ ◦ WebView ◦ Custom Tabs ◦ Progress

    Web Apps(PWA) ◦ Trusted Web Activity(TWA) • Webの資源を有効活用することができる
  2. X-Requested-With headerについて • クリック詐欺の検出やAJAXリクエストであることをサー バーに通知するために利用 • いくつかの脆弱性とプライバシー上の懸念 [3] Improving user

    privacy by requiring opt-in to send X-Requested-With header from WebView, https://android-developers.googleblog.com/2023/02/improving-user-privacy-by-requiring-opt-in-to-send-x-requested-wih-header-from-webview.html WebView サーバー XRW アプリケーション名
  3. X-Requested-With headerの非推奨化 • 段階的にX-Requested-With headerを削除 • X-Requested-With headerに依存しているアプリのために オプトインAPIが用意 [4]

    Trial for X-Requested-With in WebView Deprecation, https://developer.chrome.com/origintrials/#/view_trial/1390486384950640641
  4. ドラッグ & ドロップ対応 • WebViewから画像やテキストをドラッグ & ドロップ • AndroidManifest.xmlに追加するだけ [5]

    DropDataContentProvider, https://developer.android.com/reference/androidx/webkit/DropDataContentProvider
  5. Partial Custom Tabs [8] Bringing the best of Chrome to

    Android developers and users, https://android-developers.googleblog.com/2023/02/bringing-best-of-chrome-to-android-d evelopers-and-users.html [9] custom-tabs-example-app, https://github.com/GoogleChrome/android-browser-helper/tree/main/demos/custom-tabs-exa mple-app • 従来のCustomTabsは画面全体に オーバーレイ表示 • Partial Custom Tabsは文字通り 画面の一部分にWebコンテンツを表 示
  6. Trusted Web Activity(TWA) • フルスクリーンでのウェブコンテンツの表示を可能にするAndroid の機能 • TWAを介せばWebサイトをそのままGoogle Playに公開も •

    TWAを使うことでGoogle Playの機能を使える ◦ Google Play Dstribution ◦ Play Billing API [12] Trusted Web Activity, https://developer.chrome.com/docs/android/trusted-web-activity/
  7. References 1/2 • [1] What's new in Web on Android,

    https://youtu.be/sLn3wszcnGU • [2] WebView, https://developer.android.com/reference/android/webkit/WebView • [3] Improving user privacy by requiring opt-in to send X-Requested-With header from WebView, https://android-developers.googleblog.com/2023/02/improving-user-privacy-by-requiring-opt-in- to-send-x-requested-wih-header-from-webview.html • [4] Trial for X-Requested-With in WebView Deprecation, https://developer.chrome.com/origintrials/#/view_trial/1390486384950640641 • [5] DropDataContentProvider, https://developer.android.com/reference/androidx/webkit/DropDataContentProvider • [6] JavascriptEngine, https://developer.android.com/jetpack/androidx/releases/javascriptengine
  8. References 2/2 • [7] Custom Tabs, https://developer.chrome.com/docs/android/custom-tabs/ • [8] Bringing

    the best of Chrome to Android developers and users, https://android-developers.googleblog.com/2023/02/bringing-best-of-chrome-to-android-develope rs-and-users.html • [9] custom-tabs-example-app, https://github.com/GoogleChrome/android-browser-helper/tree/main/demos/custom-tabs-example-ap p • [10] Progressive Web Apps, https://web.dev/progressive-web-apps/ • [11] Basic offline page for web apps on Chrome Android, https://developer.chrome.com/blog/default-offline/ • [12] Trusted Web Activity, https://developer.chrome.com/docs/android/trusted-web-activity/
  9. CREDITS: This presentation template was created by Slidesgo, including icons

    by Flaticon, infographics & images by Freepik. Thanks!