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
Introducción a Firebase
Search
Cristian Fabian Gómez Rojas
July 26, 2018
Technology
88
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introducción a Firebase
Cristian Fabian Gómez Rojas
July 26, 2018
More Decks by Cristian Fabian Gómez Rojas
See All by Cristian Fabian Gómez Rojas
Atomic Design Android
iyubinest
0
46
Rx UI
iyubinest
0
38
Código limpio en la UI para Android, mejores prácticas.
iyubinest
1
300
Código limpio en la UI para Android, mejores prácticas.
iyubinest
0
380
Other Decks in Technology
See All in Technology
RAGの精度向上とエージェント活用
kintotechdev
2
130
『AIに負けない』より『AIと遊ぶ』」〜ワクワクが最強のテスト・QA学習戦略_公開用
odan611
1
390
そのタスクオンスケですか?
poropinai1966
0
130
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
11k
LiDAR SLAMの実装とセンサ融合 ~Lie群からContinuous-Time LIOまで~
naokiakai
1
970
ポストモーテム! DDoSからサイトは守れた。 でもビジネスは守れなかった。
bengo4com
0
110
FinOps X 2026 Recap from Engineer Side #JapanFinOps
chacco38
0
260
テスト設計の本質を改めて考えてみる~生成AIを活用する時代だからこそ、作ったテストの説明性を高めよう~
yamasaki696
1
290
【FinOps】データドリブンな意思決定を目指して
z63d
3
610
Hatena Engineer Seminar 37 jj1uzh
jj1uzh
0
430
AIDLC_ヤフーショッピングの取り組み
lycorptech_jp
PRO
0
530
Docker Desktop不要の時代が来る? WSL標準の「wslc」で Linuxコンテナを動かしてみた.
ueponx
0
710
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
270
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
310
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.9k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
250
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Leo the Paperboy
mayatellez
8
1.9k
The Pragmatic Product Professional
lauravandoore
37
7.4k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
630
Transcript
Introduccion a Firebase
Hola! Cristian Gomez Dev @GetPager. Encuentrame como @iyubinest 2
Agenda ▹ Que es Firebase ▹ Productos ▹ Cloud Storage
▹ Ejemplo 3
1. Que es Firebase
“ Firebase es una plataforma para el desarrollo de aplicaciones
web y aplicaciones móviles desarrollada por James Tamplin y Andrew Lee en 2011 y adquirida por Google en 2014. 5
Tu experiencia en cada plataforma Firebase permite llevar una experiencia
transversal a cada plataforma iOs, Android y la web. 6
▹ Cloud Firestore ▹ ML Kit ▹ Cloud Functions ▹
Authentications ▹ Hosting ▹ Cloud Storage ▹ Realtime DB ▹ Crashlytics ▹ Testlab ▹ etc... Productos 7
▹ Cloud Firestore ▹ ML Kit ▹ Cloud Functions ▹
Authentications ▹ Hosting ▹ Cloud Storage ▹ Realtime DB ▹ Crashlytics ▹ Testlab ▹ etc... EL producto insignia 8
Comparación Realtime DB ▹ Json ▹ Offline (Android, iOs) ▹
Consultas básicas ▹ En produccion ▹ Escalamiento fragmentado Cloud firestore ▹ Documentos ▹ Offline (Android, iOs, web) ▹ Consultas avanzadas ▹ En Beta ▹ Escalamiento automático 9
10
Codelab https://codelabs.developers.google.com/codel abs/firestore-android/#0 11
Acciones/Data ▹ Agregar ▹ Leer ▹ Borrar ▹ Actualizar ▹
Sincronizar ▹ Colecciones ▹ Documento ▹ Snapshots ▹ Documents ▹ Changes 12
13 Leer/Sincronizar //leer db.document("Some Element").get().addOnCompleteListener { task -> } //sincronizar
db.document("Some Element").addSnapshotListener{ snapshot, exception -> }
14 Agregar db.collection("notes") .add(note.asMap()) .addOnCompleteListener { task -> } .addOnFailureListener
{ exception -> }
15 Eliminar db.document("Some Element") .delete() .addOnCompleteListener { task -> }
.addOnFailureListener { exception -> }
16 Actualizar db.document("Some Element") .update(newValues) .addOnCompleteListener { task -> }
.addOnFailureListener { exception -> }
Ejemplo 17
18 Datos data class Note(val id: String, val content: String)
{ fun asMap(): Map<String, String> = mapOf( Pair("id", id), Pair("content", content) ) }
19 Adapter class Adapter : RecyclerView.Adapter<Holder>() { private val notes
= ArrayList<Note>() override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = Holder.create(LayoutInflater.from(parent.context.inflate(R.layout.note_item, parent, false)) override fun getItemCount(): Int = notes.size override fun onBindViewHolder(holder: Holder, position: Int) { holder.bind(notes[position]) } fun sync(note: Note) { notes.add(note) notifyItemInserted(notes.size - 1) } }
20 Holder class Holder(itemView: View?) : RecyclerView.ViewHolder(itemView) { companion object
{ fun create(view: View) = Holder(view) } fun bind(note: Note) { itemView.note_name.text = note.content } }
21 Sincronizar notas class MainActivity : AppCompatActivity() { override fun
onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) ... db.collection("notes") .orderBy("id", Query.Direction.ASCENDING) .addSnapshotListener { snapshot, exception -> snapshot?.run { documentChanges!! } .run { this!! } .filter { it.type == DocumentChange.Type.ADDED } .map { it.document.toNote() } .forEach { adapter.sync(it) } } } }
Gracias! Preguntas? encuentrame: @iyubinest
[email protected]
22