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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
41
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
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
19k
AIコーディングの次。コードレビューと理解負荷を解消して組織の開発生産性を高める
moongift
PRO
2
2.6k
まちスペース®とデジタルツインと「まちづくり」
hiro_ogi
0
120
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.9k
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
9k
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
2026-08-05 IBM Z開発最前線!IBM Bob Premium Package for Zって何がすごいの?
yutanonaka
0
120
関東Kaggler会発表資料
takoi
1
230
システム思考で問題に対処する
yussak
0
290
その“隠したつもり”が命取り ── 自前と平文をやめて「正解」に委ねる
kuroneko13
0
120
グローバル基準のSREは、運用現場でどう機能したか:成熟度アセスメントの実践 / SRE NEXT 2026
sorawatanabe
0
230
ハーレムエンジニアリング
kazuma777777
0
160
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
910
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
620
Mind Mapping
helmedeiros
PRO
1
310
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
280
Between Models and Reality
mayunak
4
390
Skip the Path - Find Your Career Trail
mkilby
1
180
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
56k
Believing is Seeing
oripsolob
1
190
Utilizing Notion as your number one productivity tool
mfonobong
4
540
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