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
NearByConnectionsApi
Search
funnelbit
July 21, 2015
Technology
1
420
NearByConnectionsApi
funnelbit
July 21, 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
The Rise of LLMOps
asei
7
1.4k
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
100
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
TypeScript、上達の瞬間
sadnessojisan
46
13k
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Become a Pro
speakerdeck
PRO
25
5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Building an army of robots
kneath
302
43k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Building Your Own Lightsaber
phodgson
103
6.1k
4 Signs Your Business is Dying
shpigford
180
21k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Transcript
/FBSCZ$POOFDUJPOT "1* JEGVOOFMCJU ଜɹྋ
͜Μʹͪ w JEGVOOFMCJU w ଜɹྋ w BOESPJE
ۙ͘ͷ ଞσόΠεͱͷ௨৴
ߟ͑ΒΕΔखஈ w CMVFUPPUIͰݕࡧɾ௨৴ w 23ίʔυͰσʔλΛ͢ w "OESPJE#FBNͰ௨৴ w ҐஔใͰ͓ޓ͍Λೝࣝͯ͠Կ͔Ͱ௨৴
໘ w ͱʹ͔͘ίετ͕͔͔Δ w ͋·ΓγʔϜϨεͰͳ͍ w ෳਓ͕૬खͩͬͨΒߋʹ໘ w ৗ࣌ଓ͢Δ߹ʁ
/FBSCZ
/FBSCZ w ۙ͘ʹ͍ΔσόΠεͱଓͯ͠ΓͱΓͰ͖Δ w /FBSCZ.FTTBHFT w /FBSCZ$POOFDUJPOT
w XJp CMVFUPPUI ਓؒʹฉ͑͜ͳ͍ԻͰ௨৴ w (PPHMF1MBZ4FSWJDFT ༧ఆ w J04Ͱ͑Δ
༧ఆ w Ұ෦ͷΞϓϦઌߦ࠾༻ /FBSCZ.FTTBHFT
/FBSCZ$POOFDUJPOT w ϩʔΧϧωοτϫʔΫܦ༝Ͱଓ w ϚϧνϓϨΠήʔϜͳͲʹ͑Δ w ͢Ͱʹར༻Մೳ w ࠓ͢ͷͪ͜ΒͰ͢
/FBSCZ$POOFDUJPOT"1* w (PPHMF1MBZ4FSWJDFT ͔Βར༻Մೳ w (PPHMF"QJ$MJFOUΛར༻ w ඞཁͳQFSNJTTJPO A"$$&44@/&5803,@45"5&AͷΈ
w ϩʔΧϧωοτϫʔΫͷଓඞਢ
Nearby.Connections.startAdvertising Nearby.Connections.startDiscovery Nearby.Connections.sendConnectionRequest Nearby.Connections.acceptConnectionRequest Nearby.Connections.rejectConnectionRequest Nearby.Connections.sendReliableMessage Nearby.Connections.sendUnreliableMessage … /FBSCZ$POOFDUJPOT"1*
w (PPHMF"QJ$MJFOU#VJMEFSʹ͢ఆ mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Nearby.CONNECTIONS_API) .build();
/FBSCZ$POOFDUJPOT@"1*
w ଞͷσόΠε͔ΒݕࡧՄೳͳঢ়ଶʹ͢Δ Nearby.Connections.startAdvertising(mGoogleApiClient, name, appMetadata, TIMEOUT_ADVERTISE, this).setResultCallback(new ResultCallback<Connections.StartAdvertisingResult>() { @Override
public void onResult(Connections.StartAdvertisingResult result) { // ͳʹ͔ } }); TUBSU"EWFSUJTJOH
w ଞͷσόΠεͷ୳ࡧΛ։࢝͢Δ Nearby.Connections.startDiscovery(mGoogleApiClient, serviceId, TIMEOUT_DISCOVER, this) .setResultCallback(new ResultCallback<Status>() { @Override
public void onResult(Status status) { // ͳʹ͔ } }); TUBSU%JTDPWFSZ
w ଞσόΠεʹଓϦΫΤετΛૹΔ Nearby.Connections.sendConnectionRequest(mGoogleApiClient , myName, endpointId, myPayload, new Connections.ConnectionResponseCallback() {
@Override public void onConnectionResponse(String endpointId, Status status, byte[] bytes) { mOtherEndpointId = endpointId; } }, this); TFOE$POOFDUJPO3FRVFTU
w ଓϦΫΤετΛڐՄ͠ɺଓঢ়ଶʹ͢Δ Nearby.Connections.acceptConnectionRequest(mGoogleApiClient , endpointId, payload, MainActivity.this) .setResultCallback(new ResultCallback<Status>() {
@Override public void onResult(Status status) { // ͳʹ͔ } }); BDDFQU$POOFDUJPO3FRVFTU
w ଓϦΫΤετΛڋ൱ Nearby.Connections.rejectConnectionRequest(mGoogleApiClient , endpointId); SFKFDU$POOFDUJPO3FRVFTU
w ϝοηʔδΛૹΔ CZUF w ࣮֬ʹ͍ͨ͠ϝοηʔδ͕͋Δͱ͖ʹ͏ w ҉߸Խ͞Εͳ͍ͷͰҙ Nearby.Connections.sendReliableMessage(mGoogleApiClient, mOtherEndpointId,
msg.getBytes()); TFOE3FMJBCMF.FTTBHF
w ෳͷѼઌʹૹΔ͜ͱͰ͖Δ List<String> mOtherEndpointIds; … Nearby.Connections.sendReliableMessage(mGoogleApiClient, mOtherEndpointIds, msg.getBytes()); TFOE3FMJBCMF.FTTBHF
Nearby.Connections.sendUnreliableMessage(mGoogleApiClient , mOtherEndpointId, msg.getBytes()); w TFOE3FMJBCMF.FTTBHFΑΓߴ w ૹ৴ՄೳαΠζ͕TFOE3FMJBCMF.FTTBHFΑΓ খ͍͞ w
ॏཁͰͳ͍ใΛසൟʹૹΔ߹ʹ༻ TFOE6OSFMJBCMF.FTTBHF
·ͱΊ w ৭ΜͳσόΠεͱίετͰܨ͛Δࣄ͕Մೳ w ໘ന͍ w (PPHMF1MBZ4FSWJDFT͑͞ೖΕΕ͑Δ
ৄࡉ w /FBSCZ$POOFDUJPOT"1* w IUUQTEFWFMPQFSTHPPHMFDPNOFBSCZ DPOOFDUJPOTPWFSWJFX
͋Γ͕ͱ͏͍͟͝·ͨ͠