Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
webMessaging
Search
funnelbit
July 14, 2015
Technology
1
2.7k
webMessaging
funnelbit
July 14, 2015
Tweet
Share
More Decks by funnelbit
See All by funnelbit
Hatena Engineer Seminar #9
funnelbit
5
7.2k
droidkaigi-2017-renovation
funnelbit
10
10k
Dart
funnelbit
0
250
BottomBarAndSnackBar
funnelbit
0
460
Dagger2 Optional bindings
funnelbit
0
530
WearableRecyclerView
funnelbit
1
770
QucikSettingsTileAPI
funnelbit
0
340
Mobile Vision
funnelbit
0
430
AwarenessAPI
funnelbit
0
130
Other Decks in Technology
See All in Technology
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
310
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
990
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
7
810
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
990
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
180
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Happy Clients
brianwarren
98
6.7k
Being A Developer After 40
akosma
86
590k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Faster Mobile Websites
deanohume
305
30k
Teambox: Starting and Learning
jrom
133
8.8k
A designer walks into a library…
pauljervisheath
203
24k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Become a Pro
speakerdeck
PRO
25
5k
Transcript
"OESPJE.͔Βͷ 8FC.FTTBHJOH JEGVOOFMCJU
͜Μʹͪ w JEGVOOFMCJU w ଜɹྋ
+4ͱ+BWBͷ௨৴
ݱঢ়ͷ+4ͱͷ௨৴ +4ʹ͢ mWebView.loadUrl( "javascript:document.getElementById('content').innerHTML=\ "͜Μʹͪ\""); mWebView.evaluateJavascript( "var content = document.getElementById('content');"
+ "content.innerHTML = \"͜Μʹͪ\"" , null); w "1*-FWFMd
͜Ε·Ͱͷ+4ͱͷ௨৴ +4͔Βड͚औΔ mWebView.addJavascriptInterface(new JavaScriptInterface(), “Callback"); private class JavaScriptInterface { @JavascriptInterface
public void onEdit(String text) { // ͜Μʹͪ } }
໘ w +4ʹͪΐͬͱΛ͚ͩ͢Ͱ͍͢͝खؒ w จࣈྻͳ+4͕+BWBʹฆΕࠐΉ
)5.-8FC.FTTBHJOH w JGSBNFXJOEPXؒͷ௨৴ΛՄೳͱ͢Δ w QPTU.FTTBHF w .FTTBHF$IBOOFMΛར༻ͨ͠ QPTU.FTTBHF
QPTU.FTTBHF JGSBNFTSDlEPNFJOzJGSBNF ʜ WBSJGSBNFEPDVNFOUHFU&MFNFOU#Z*E QBHF JGSBNFDPOUFOU8JOEPXQPTU.FTTBHF ͜Μʹͪ lEPNBJOl
WBSSFDFJWF.FTTBHFGVODUJPO FWFOU \ DPOTPMFMPH PL ^ XJOEPXBEE&WFOU-JTUFOFS NFTTBHF SFDFJWF.FTTBHF w QBHF w QBHF
QPTU.FTTBHF NFTTBHFDIBOOFM WBSSFDFJWF.FTTBHFGVODUJPO FWFOU \ WBSQPSUFWFOUQPSUT<> QPSUTUBSU QPSUQPTU.FTTBHF ͋Γ͕ͱ͏
^ XJOEPXBEE&WFOU-JTUFOFS NFTTBHF SFDFJWF.FTTBHF GBMTF w QBHF w QBHF WBSDIBOOFMOFX.FTTBHF$IBOOFM WBSJGSBNFEPDVNFOUHFU&MFNFOU#Z*E QBHF WBSQPSUDIBOOFMQPSU QPSUTUBSU QPSUBEE&WFOU-JTUFOFS NFTTBHF GVODUJPO F \ DPOTPMFMPH Αͬ͠Ό ^ JGSBNFDPOUFOU8JOEPXQPTU.FTTBHF ͜Μʹͪ <DIBOOFMQPSU>
8FC.FTTBHF༻ Ϋϥεͱϝιου w BOESPJEXFCLJU w 8FC.FTTBHF w 8FC.FTTBHF1PSU w 8FC.FTTBHF1PSUQPTU.FTTBHF
w 8FC.FTTBHF1PSU8FC.FTTBHF$BMMCBDL w BOESPJEXFCLJU8FC7JFX w 8FC7JFXDSFBUF8FC.FTTBHF$IBOOFM w 8FC7JFXQPTU8FC.FTTBHF
w ૹ৴͢ΔϝοηʔδΛදͨ͠Ϋϥε WebMessage webMessage = new WebMessage("͜Μʹͪ"); w .FTTBHF1PSUTΛҾʹऔΕΔ WebMessage
webMessage = new WebMessage("portͩΑ", ports); 8FC.FTTBHF
w .FTTBHF$IBOOFMͰ͏ϙʔτ w +4ͷ.FTTBHF$IBOOFMQPSUPS .FTTBHF$IBOOFMQPSU૬ 8FC.FTTBHF1PSU
w .FTTBHF$IBOOFMͰQPTU͢Δ mWebMessagePort1.postMessage(webMessage); 8FC.FTTBHF1PSU QPTU.FTTBHF 8FC.FTTBHF
w .FTTBHF$IBOOFMͰड৴ͨ͠༰Λड͚औΔ port1.setWebMessageCallback(new WebMessagePort.WebMessageCallback() { @Override public void onMessage(WebMessagePort port,
WebMessage message) { super.onMessage(port, message); Log.e("onMessage", message.getData()); } }); 8FC.FTTBHF1PSU8FC.FT TBHF$BMMCBDL
w .FTTBHF$IBOOFMΛ࡞Δ w ྻͰQPSU͕ͭฦͬͯ͘Δ mWebMessagePorts = mWebView.createWebMessageChannel(); WebMessagePort port1 =
mWebMessagePorts[0]; WebMessagePort port2 = mWebMessagePorts[1]; 8FC7JFX DSFBUF8FC.FTTHF$IBOOFM
w 8FC7JFXͰදࣔதͷ1BHFʹQPTU.BTTBHF͢Δ mWebView.postWebMessage(webMessage, uri); 8FC7JFX QPTU8FC.FTTBHF
ྫ
ྫ mWebMessagePorts = mWebView.createWebMessageChannel(); WebMessagePort port1 = mWebMessagePorts[0]; WebMessagePort port2
= mWebMessagePorts[1]; … port1.setWebMessageCallback(new WebMessagePort.WebMessageCallback() { … }}); … WebMessagePort[] ports = {port2}; WebMessage webMessage = new WebMessage("͜ΜʹͪportsͰ͢ ", ports); mWebView.postWebMessage(webMessage, uri);
·ͱΊ w +BWBʹจࣈྻͳ+4͕ฆΕࠐ·ͳ͍ w )5.-ͷඪ४ͳͷͰ൚༻త w ·ͩQSFWJFXஈ֊Ͱมߋ͕ଟ͍ͷͰҙ QSFWJFXQPTU.FTTBHF5P.BJO'SBNF QSFWJFXQPTU8FC.FTTBHF
͋Γ͕ͱ͏͍͟͝·ͨ͠