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
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
200
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
230
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
390
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
130
TypeScript、上達の瞬間
sadnessojisan
46
13k
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
Terraform Stacks入門 #HashiTalks
msato
0
360
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.5k
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
65
4.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
The Language of Interfaces
destraynor
154
24k
It's Worth the Effort
3n
183
27k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Music & Morning Musume
bryan
46
6.2k
A designer walks into a library…
pauljervisheath
204
24k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Designing Experiences People Love
moore
138
23k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
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
͋Γ͕ͱ͏͍͟͝·ͨ͠