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
470
Dagger2 Optional bindings
funnelbit
0
540
WearableRecyclerView
funnelbit
1
780
QucikSettingsTileAPI
funnelbit
0
350
Mobile Vision
funnelbit
0
440
AwarenessAPI
funnelbit
0
130
Other Decks in Technology
See All in Technology
メンタル面でもつよつよエンジニアになる/登壇資料(井田 献一朗)
hacobu
0
160
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
230
効率的な技術組織が作れる!書籍『チームトポロジー』要点まとめ
iwamot
2
180
AIエージェントに脈アリかどうかを分析させてみた
sonoda_mj
2
120
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
440
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
210
OPENLOGI Company Profile for engineer
hr01
1
17k
AWS環境におけるランサムウェア攻撃対策の設計
nrinetcom
PRO
1
300
20241220_S3 tablesの使い方を検証してみた
handy
4
830
pg_bigmをRustで実装する(第50回PostgreSQLアンカンファレンス@オンライン 発表資料)
shinyakato_
0
140
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
550
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
710
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
67
4.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
1
140
A designer walks into a library…
pauljervisheath
205
24k
Scaling GitHub
holman
459
140k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
97
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
840
Designing for humans not robots
tammielis
250
25k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
GraphQLとの向き合い方2022年版
quramy
44
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
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
͋Γ͕ͱ͏͍͟͝·ͨ͠