SlideShare a Scribd company logo
2016年11月20日
devcussion
2016年12月03日
わんくま勉強会東京
B.G
※この発言は個人の見解であり、所属する組織
の公式見解ではありません
 HN: B.G
 TwitterID:
 @miu_hiro_(メイン, 仕事だけだったはず
が・・・。)
 @bg1_333(元メイン, 同人関係その他)
 Blog:
 車輪のx発明 ~B.G's Blog~
 (http://bg1.hatenablog.com/)
 言語・環境など:
 C++(とくにC++1x)わかりません
 C#わかりません
 Javaわかりません
 Win32マン
 Androidわかりません
 でも最近はAndroid(Java)やらされてるマン
おしらせ
Slack
https://gpd-win-ug.slack.com/
GPD WIN Advent Calendar 2016
http://www.adventar.org/calendars/1529
Androidわからないマンが
ブラウザを作ることになった
というお話
Webページの画面は?
↓
WebView
(Zinc #2 WebViewの設置)
※他にChromeView、ChromeCustomTabs、Crosswalk、あとは
Chromiumを載せるとか?
ありません
↓
自前でエディットテキストで実装
(Zinc #2 WebViewの設置)
(Zinc #8 リンク先URLをURLバーに反映)
特定のページでChromeに
リダイレクトしちゃう
↓
WebViewClientをオーバーライド
してfalseを返す
(Zinc #3 一部のサイトでChromeにリダイレクトす
る動作を防止)
ありません
(Android6.0で消えました)
Android 6.0 Changes | Android Developers
↓
自前でDB実装
(Zinc #6 ブックマークDBテーブルへの登録)
ロード時のhttp補完と
表示時のhttp省略
↓
自前で実装
( Zinc #9 ロード時のhttp補完および表示時のhttp省
略)
ありません
(WebBackForwardListは
いわゆる通算の履歴ではありません)
WebBackForwardList | Android Developers
↓
自前でDB実装
( Zinc #12 履歴機能の実装)
URLバー入力してリターン
したらロードしたい
↓
OnEditorAction
(Zinc #13 URLバー内でのEnterキーでWebページを
ロード)
回転止めちゃえばいい
↓
configChanges
(Zinc #17 回転時のActivity再生成によりWebViewの
内容が消える問題の対策 その2)
検索したい
↓
SearchViewとかOnQueryTextListener
(Zinc #18 ページ内検索の実装)
FragmentTabHostかな?
↓
WebView状態が保持できないし、タブを
1つだけ削除ができない(全削除のみ)
なので結局タブはなくしてFragment
だけに
(Zinc #21 タブの削除)
(Zinc #35 タブの切り替え)
特定のURLでブロックしたい
↓
loadUrl前にチェックしてstopLoading
(Zinc#27 簡易的なWebフィルタリング
(WebView.stopLoading
でロードを停止))
WebViewClientの中で
ブロックしたい
↓
shouldOverrideUrlLoadingとかonLoadResource
でチェックしてstopLoading
(単にtrue返すと固まった)
(Zinc#27 簡易的なWebフィルタリング(WebView.stopLoading
でロードを停止))
フィルタリングAPIがサーバだったら
非同期HTTPリクエストしないと
↓
非同期関数の同期化
(syncronized わからないマン)
変なところでstopLoadingすると
固まる
↓
ローカルHTMLをloadUrlして流してあげて
その上にブロックフラグメントかぶせる
↓
先日試したら再現しなかったので
関係なかった
AsyncTaskLoaderでつくってたら
↓
CountDownLatchというのがあるらし
い
([Android] 何人かの非同期処理を待ち合わせる | ア
ドカレ2013 : SP #23 ...)
バックキーで戻るとリダイレクト
のタイミング次第で
表示されるときがある
↓
戻る場合はshouldOverrideUrlLoading
通らないので、onPageStartedで
ブロックしたほうが確実だった
onReceivedErrorとか
onReceivedHttpErrorとか
あったのか
↓
これでリダイレクト制御すればよかっ
たかも
どこがいいかな
↓
とりあえず
Google Safe Browsing?
(試してないけど)
(Google Safe Browsing | Google Developers)
他のブラウザ作ってる人どうしてるんでしょうか?
Chromium載せてるのかな・・・。
Xamarinで作る場合とかどうするんでしょうか?
教えていただきたい
https://github.com/bg1bgst333/Zinc

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

ブラウザはつくるもんじゃない