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
Firebaseを使ってみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Katsuya Kato
February 24, 2016
Technology
0
49
Firebaseを使ってみた
関西モバイルアプリ研究会 #11 資料
Katsuya Kato
February 24, 2016
Tweet
Share
More Decks by Katsuya Kato
See All by Katsuya Kato
複業メンバーと共に創るカウシェ
katsuyax
0
740
AndroidThingsとFirebaseで始めるホームセキュリティ / Android Things Home Security
katsuyax
2
5.4k
WWDCでこの先生きのこるには / WWDC2017
katsuyax
0
100
watchOS3の新機能 / watchos3
katsuyax
0
96
iPhone(iOS)のアプリ内課金 / in app purchase
katsuyax
0
110
Other Decks in Technology
See All in Technology
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
680
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
120
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
600
Webhook best practices for rock solid and resilient deployments
glaforge
2
300
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
2k
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
350
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
140
Tebiki Engineering Team Deck
tebiki
0
24k
配列に見る bash と zsh の違い
kazzpapa3
3
160
CDKで始めるTypeScript開発のススメ
tsukuboshi
1
480
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
650
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
220
GitHub's CSS Performance
jonrohan
1032
470k
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Utilizing Notion as your number one productivity tool
mfonobong
3
220
BBQ
matthewcrist
89
10k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
Navigating Weather and Climate Data
rabernat
0
110
Design in an AI World
tapps
0
140
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
280
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
330
Paper Plane
katiecoart
PRO
0
46k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Transcript
'JSFCBTFΛͬͯΈͨ ,BUTVZB,BUP
ࣗݾհ w Ճ౻উ w ΈࠐΈۀք͔ΒϞόΠϧۀքʹ ͖ͬͯͯ w ڈʹຊग़͠·ͨ͠
'JSFCBTFΛ ͬͯΈͨΛ͠·͢
'JSFCBTFͱ w ݄ʹ(PPHMFʹങऩ͞Εͨ#BB4ʢ#BDLFOEBTB 4FSWJDFʣ w ετϨʔδɺϢʔβʔཧͳͲΞϓϦέʔγϣϯͷόοΫΤϯ υͱͯ͠ඞཁͱͳΔػೳΛαʔϏεΛఏڙͯ͘͠ΕΔ w νϟοτΞϓϦͷΑ͏ͳϦΞϧλΠϜʹσʔλΛಉظ͢Δඞཁ ͕͋ΔαʔϏεʹద͍ͯ͠Δ
w /P42-ɻ+40/ΦϒδΣΫτͱͯ͠อ࣋͞ΕΔ w ΦϑϥΠϯͷॲཧ͍͍ײ͡ʹͬͯ͘ΕΔʢΒ͍͠ʣ
ͳͥ'JSFCBTF͔
ͳͥ'JSFCBTFͳͷ͔ w J04"OESPJEͰखܰʹ͏͜ͱ͕Ͱ͖ΔͷΛ ୳ͯͨ͠ w ಥવͷ1BSTFDPNऴྃͷ͓Βͤ w ͪΐͬͱ͏͚ͩͳΒֶशίετ͕ͯ͘ࡁΉ ͷͷΛɾɾɾ
ͬͯΈΔ
ΞΧϯτొ w IUUQTXXXpSFCBTFDPN
ཧը໘
ཧը໘ Ճ͞Εͨσʔλ͕ ͜͜ʹදࣔ͞Ε͍ͯ͘
νϟοτΞϓϦΛ ࡞ͬͯΈΔ
None
4%,ͷಋೖ
$PDPB1PET
pod 'Firebase'
ॳظઃఆˍಡΈॻ͖
ॳظઃఆ firebaseRef = Firebase(url:"https:// kanmoba.firebaseio.com/chat/message")
σʔλͷॻ͖ࠐΈ let messageData = ["name":nameTextField.text!, "message": messageTextField.text!] firebaseRef.childByAutoId().setValue(messageData) /4%JDUJPOBSZͰॻ͖ࠐΉσʔλΛ४උ *%ΛϥϯμϜͰੜ͢Δϝιου
σʔλͷॻ͖ࠐΈʢૹ৴ʣ
ཧը໘ͰݟͯΈΔ
σʔλͷಡΈग़͠ firebaseRef.observeEventType(.ChildAdded, withBlock: { snapshot in if let name =
snapshot.value.objectForKey("name") as? String, message = snapshot.value.objectForKey("message") as? String { self.textView.text = "\(self.textView.text)\n\(name) : \(message)" } }) ࢹ͢ΔΠϕϯτΛొ ࢠ͕Ճ͞Εͨͱ͖Λࢹ͢Δ LFZΛࢦఆͯ͠ΛಘΔ
σϞ
None
͘Β͍Ͱ Ͱ͖ͯ͠·ͬͨͷͰ
"OESPJEɾɾɾ
4%,
(SBEMF
HSBEMFCVMJE dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.firebase:firebase-client-android:2.5.2+' }
HSBEMFCVMJE packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE-FIREBASE.txt' exclude 'META-INF/NOTICE' }
ॳظઃఆˍಡΈॻ͖
ͦͷલʹ1FSNJTTJPO <uses-permission android:name="android.permission.INTERNET" />
ॳظઃఆ Firebase.setAndroidContext(this); firebaseRef = new Firebase("https://kanmoba.firebaseio.com/ chat/message");
σʔλͷॻ͖ࠐΈ HashMap<String, String> post = ɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹnew HashMap<String, String>(); post.put("name", nameEditText.getText().toString());
post.put("message", messageEditText.getText().toString()); firebaseRef.push().setValue(post) DIJME#Z"VUP*Eϝιου͕ ແ͔ͬͨɾɾɾ
σʔλͷಡΈग़͠ firebaseRef.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String
s) { HashMap hash = (HashMap)dataSnapshot.getValue(); textView.setText(textView.getText() + ɹɹɹɹɹɹɹɹɹɹ ɹɹɹɹ"\n" + hash.get("name") + " : " + ɹɹɹɹɹɹɹɹɹɹɹɹɹɹ hash.get("message")); } } ϦεφʔΛొ
σϞ
None
ͦͷଞؾʹͳΔͱ͜ΖΛ
όΠφϦʁ w #"4&Τϯίʔυ͢Ε0,
Ձ֨
ηΩϡϦςΟ w ʮ3VMFTʯΛઃఆ͢Δ͜ͱͰΞΫηε੍ݶ͕Ͱ͖Δ
σʔλͷαΠζΛ੍ݶ
ϩάΠϯ͍ͯ͠ΔਓͷΈڐՄ
ؾʹͳΔ͜ͱ w σʔλ͕૿͑ͨ࣌ʹ͕͘ͳΒͳ͍͔ʁ w 'JSFCBTFʹ164)৴ػೳ͕ແ͍ w 1FSTFΛϗεςΟϯάͨ͠ํ͕ͬͺΓྑ͍ʁ w Φεεϝͷ#BB4͕Γ͍ͨ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠