SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Fragments
Todo lo que debes saber para programar apps
              multidispositivo.




                        http://androidtitlan.mx
Who i am?


     http://androidtitlan.mx
Enrique Díaz
GDG AndroidTitlan founder
     Android Hacker




               http://androidtitlan.mx
Indice     0. ¿Quién soy?
           0. Contexto Histórico
           1. Fragment
           2. Ejemplo 0:
           SimpleFragment
           3. Conclusiones
           4. Q & A




         http://androidtitlan.mx
http://androidtitlan.mx
Contexto
Histórico

     http://androidtitlan.mx
http://androidtitlan.mx
Contexto
Octubre 2008: Primer
smartphone con Android
                 API level = 1




               http://androidtitlan.mx
http://androidtitlan.mx
Contexto
Septiembre 2009: Android
Donut 1.6;
ldpi, mdpi & hdpi
API level = 4



                    http://androidtitlan.mx
http://androidtitlan.mx
Contexto
Febrero 2011:
           Android HoneyComb
            Nuevo identificador
                         xhdpi
                 API level = 11


                http://androidtitlan.mx
http://androidtitlan.mx
Contexto
Julio 2011: Android 3.2
                       Google TV
                   API level = 13




                  http://androidtitlan.mx
http://androidtitlan.mx
Fragment

 http://androidtitlan.mx
http://androidtitlan.mx
Fragment
API level 11
Android compatibility
package
Sub activity
Maneja su propio ciclo de
vida
               http://androidtitlan.mx
http://androidtitlan.mx
Ejemplo:
SimpleFragment



             http://androidtitlan.mx
SimpleFragments
                   Fragments FTW!


0. Creamos un nuevo proyecto llamado
“SimpleFragments”
1. Creamos una clase llamada ArticleFragment
que herede de Fragment
2. Agregamos ArticleFragment a la actividad
principal a través de XML
3. Agregamos un fragment a una activity en
tiempo de ejecución
4. Generamos la comunicación entre fragments
                              http://androidtitlan.mx
http://androidtitlan.mx
0. Creamos un nuevo
  proyecto llamado
 “SimpleFragments”



          http://androidtitlan.mx
http://androidtitlan.mx
1. Creamos una clase llamada
ArticleFragment que herede
        de Fragment


               http://androidtitlan.mx
http://androidtitlan.mx
2. Agregamos
ArticleFragment a la activity
       principal vía XML



                http://androidtitlan.mx
http://androidtitlan.mx
3. Agregamos un fragment a
   un activity en tiempo de
          ejecución


               http://androidtitlan.mx
http://androidtitlan.mx
4. Generamos la comunicación
      entre fragments



               http://androidtitlan.mx
http://androidtitlan.mx
¿Dudas?


    http://androidtitlan.mx
https://github.com/nRike/
    SimpleFragments


              http://androidtitlan.mx
Descarga el
 código fuente:
https://github.com/nRike/
    SimpleFragments


              http://androidtitlan.mx
Resumen


    http://androidtitlan.mx
SimpleFragment
+ Un fragment es una sub-actividad
+ Los fragments manejan su propio ciclo de
vida,
+ Fragments resuelven un problema de
diseño
+ Son de vital importancia para tablets &
Google TV
+ Android compatibility package nos permite
utilizar Fragments en Donut
Q&A



  http://androidtitlan.mx
by

http://bit.ly/and-drinks


                http://androidtitlan.mx
Te invito a And-
     Drinks
 AndroidTitlan:
           by

http://bit.ly/and-drinks


                http://androidtitlan.mx
Fragments
Todo lo que debes saber para programar apps
              multidispositivo.




            ¡Gracias!

Weitere ähnliche Inhalte

Andere mochten auch

Android best practices
Android best practicesAndroid best practices
Android best practicesEnrique Diaz
 
Excel macro for solving a polynomial equation
Excel macro for solving a polynomial equationExcel macro for solving a polynomial equation
Excel macro for solving a polynomial equationUpendra Lele
 
Excel macro for integration of a function
Excel macro for integration of a functionExcel macro for integration of a function
Excel macro for integration of a functionUpendra Lele
 
Angl prepa namur and malonne
Angl prepa namur and malonneAngl prepa namur and malonne
Angl prepa namur and malonnewilh18
 
Angl; pre. namur and malonne
Angl; pre. namur and malonneAngl; pre. namur and malonne
Angl; pre. namur and malonnewilh18
 
Case study in Entrepreneurship (new Business set up)
Case study in Entrepreneurship (new Business set up)Case study in Entrepreneurship (new Business set up)
Case study in Entrepreneurship (new Business set up)Upendra Lele
 
How Android API's evolved: Viewflipper vs ViewPager
How Android API's evolved: Viewflipper vs ViewPagerHow Android API's evolved: Viewflipper vs ViewPager
How Android API's evolved: Viewflipper vs ViewPagerEnrique Diaz
 
Capacity planning case study 2
Capacity planning case study 2Capacity planning case study 2
Capacity planning case study 2Upendra Lele
 
Управление проектами (Алексей Васюков, ITD Systems)
Управление проектами (Алексей Васюков, ITD Systems)Управление проектами (Алексей Васюков, ITD Systems)
Управление проектами (Алексей Васюков, ITD Systems)Oksana Kurysheva
 
Incredible india presentation
Incredible india presentationIncredible india presentation
Incredible india presentationUpendra Lele
 

Andere mochten auch (14)

Android best practices
Android best practicesAndroid best practices
Android best practices
 
Otsoak
OtsoakOtsoak
Otsoak
 
Excel macro for solving a polynomial equation
Excel macro for solving a polynomial equationExcel macro for solving a polynomial equation
Excel macro for solving a polynomial equation
 
Excel macro for integration of a function
Excel macro for integration of a functionExcel macro for integration of a function
Excel macro for integration of a function
 
Otsoak
OtsoakOtsoak
Otsoak
 
Angl prepa namur and malonne
Angl prepa namur and malonneAngl prepa namur and malonne
Angl prepa namur and malonne
 
Angl; pre. namur and malonne
Angl; pre. namur and malonneAngl; pre. namur and malonne
Angl; pre. namur and malonne
 
Case study in Entrepreneurship (new Business set up)
Case study in Entrepreneurship (new Business set up)Case study in Entrepreneurship (new Business set up)
Case study in Entrepreneurship (new Business set up)
 
Dajjal
DajjalDajjal
Dajjal
 
How Android API's evolved: Viewflipper vs ViewPager
How Android API's evolved: Viewflipper vs ViewPagerHow Android API's evolved: Viewflipper vs ViewPager
How Android API's evolved: Viewflipper vs ViewPager
 
Mtqss2014
Mtqss2014Mtqss2014
Mtqss2014
 
Capacity planning case study 2
Capacity planning case study 2Capacity planning case study 2
Capacity planning case study 2
 
Управление проектами (Алексей Васюков, ITD Systems)
Управление проектами (Алексей Васюков, ITD Systems)Управление проектами (Алексей Васюков, ITD Systems)
Управление проектами (Алексей Васюков, ITD Systems)
 
Incredible india presentation
Incredible india presentationIncredible india presentation
Incredible india presentation
 

Ähnlich wie Fragments, all you need to know for create multi-device apps.

Desarollando aplicaciones móviles con Python y Android
Desarollando aplicaciones móviles con Python y AndroidDesarollando aplicaciones móviles con Python y Android
Desarollando aplicaciones móviles con Python y AndroidTatiana Al-Chueyr
 
Desarrollo de aplicaciones android con Python
Desarrollo de aplicaciones android con PythonDesarrollo de aplicaciones android con Python
Desarrollo de aplicaciones android con PythonManuel Pérez
 
Curso de programacion en android
Curso de programacion en androidCurso de programacion en android
Curso de programacion en androidikalbeniz
 
Fundamentos de python con orientación a objetos y basado en problemas con bas...
Fundamentos de python con orientación a objetos y basado en problemas con bas...Fundamentos de python con orientación a objetos y basado en problemas con bas...
Fundamentos de python con orientación a objetos y basado en problemas con bas...Universidad de San Buenaventura Medellín
 
Consejos de programación para un joven estudiante
Consejos de programación para un joven estudianteConsejos de programación para un joven estudiante
Consejos de programación para un joven estudianteGiovanni Cortés
 
Trabajo de NTICS II
Trabajo de NTICS IITrabajo de NTICS II
Trabajo de NTICS IImarco_acuna
 
Presentacion android mistela&tweets
Presentacion android mistela&tweetsPresentacion android mistela&tweets
Presentacion android mistela&tweetsJorge Soro
 
Python en Android,Charla del FUDcon Latam 2012
Python en Android,Charla del FUDcon Latam 2012Python en Android,Charla del FUDcon Latam 2012
Python en Android,Charla del FUDcon Latam 2012Ernesto Crespo
 
2.1 android cep jaen 2014 estructura de aplicación
2.1 android cep jaen 2014   estructura de aplicación2.1 android cep jaen 2014   estructura de aplicación
2.1 android cep jaen 2014 estructura de aplicaciónJose Antonio Vacas
 
Curso de programacion en android
Curso de programacion en androidCurso de programacion en android
Curso de programacion en androidKiKe Cm
 
Construyendo una app Android sobre la nube App Engine
Construyendo una app Android sobre la nube App EngineConstruyendo una app Android sobre la nube App Engine
Construyendo una app Android sobre la nube App EngineGDG Lima
 
Android reversing 101.pdf
Android reversing 101.pdfAndroid reversing 101.pdf
Android reversing 101.pdfJosé Moreno
 
Presentacion Plataformas moviles
Presentacion Plataformas movilesPresentacion Plataformas moviles
Presentacion Plataformas movilesDr. Edwin Hernandez
 
Charla GDG Madrid: Cordova + AngularJS + Ionic
Charla GDG Madrid: Cordova + AngularJS + IonicCharla GDG Madrid: Cordova + AngularJS + Ionic
Charla GDG Madrid: Cordova + AngularJS + IonicRubén Aguilera
 
Mdw guia-android-1.3
Mdw guia-android-1.3Mdw guia-android-1.3
Mdw guia-android-1.3ERWIN AGUILAR
 

Ähnlich wie Fragments, all you need to know for create multi-device apps. (20)

Desarollando aplicaciones móviles con Python y Android
Desarollando aplicaciones móviles con Python y AndroidDesarollando aplicaciones móviles con Python y Android
Desarollando aplicaciones móviles con Python y Android
 
Desarrollo de aplicaciones android con Python
Desarrollo de aplicaciones android con PythonDesarrollo de aplicaciones android con Python
Desarrollo de aplicaciones android con Python
 
Adtg como realice el app en android - usmp
Adtg   como realice el app en android - usmpAdtg   como realice el app en android - usmp
Adtg como realice el app en android - usmp
 
Curso de programacion en android
Curso de programacion en androidCurso de programacion en android
Curso de programacion en android
 
Fundamentos de python con orientación a objetos y basado en problemas con bas...
Fundamentos de python con orientación a objetos y basado en problemas con bas...Fundamentos de python con orientación a objetos y basado en problemas con bas...
Fundamentos de python con orientación a objetos y basado en problemas con bas...
 
Consejos de programación para un joven estudiante
Consejos de programación para un joven estudianteConsejos de programación para un joven estudiante
Consejos de programación para un joven estudiante
 
Trabajo de ntics ii
Trabajo de ntics iiTrabajo de ntics ii
Trabajo de ntics ii
 
Trabajo de NTICS II
Trabajo de NTICS IITrabajo de NTICS II
Trabajo de NTICS II
 
Presentacion android mistela&tweets
Presentacion android mistela&tweetsPresentacion android mistela&tweets
Presentacion android mistela&tweets
 
Python en Android,Charla del FUDcon Latam 2012
Python en Android,Charla del FUDcon Latam 2012Python en Android,Charla del FUDcon Latam 2012
Python en Android,Charla del FUDcon Latam 2012
 
2.1 android cep jaen 2014 estructura de aplicación
2.1 android cep jaen 2014   estructura de aplicación2.1 android cep jaen 2014   estructura de aplicación
2.1 android cep jaen 2014 estructura de aplicación
 
Curso de programacion en android
Curso de programacion en androidCurso de programacion en android
Curso de programacion en android
 
Api rest client en Android
Api rest client en AndroidApi rest client en Android
Api rest client en Android
 
Construyendo una app Android sobre la nube App Engine
Construyendo una app Android sobre la nube App EngineConstruyendo una app Android sobre la nube App Engine
Construyendo una app Android sobre la nube App Engine
 
Android reversing 101.pdf
Android reversing 101.pdfAndroid reversing 101.pdf
Android reversing 101.pdf
 
Symfony Parte 2
Symfony Parte 2Symfony Parte 2
Symfony Parte 2
 
Presentacion Plataformas moviles
Presentacion Plataformas movilesPresentacion Plataformas moviles
Presentacion Plataformas moviles
 
S8-DS2.pptx
S8-DS2.pptxS8-DS2.pptx
S8-DS2.pptx
 
Charla GDG Madrid: Cordova + AngularJS + Ionic
Charla GDG Madrid: Cordova + AngularJS + IonicCharla GDG Madrid: Cordova + AngularJS + Ionic
Charla GDG Madrid: Cordova + AngularJS + Ionic
 
Mdw guia-android-1.3
Mdw guia-android-1.3Mdw guia-android-1.3
Mdw guia-android-1.3
 

Mehr von Enrique Diaz

Cómo convertirse en experto
Cómo convertirse en expertoCómo convertirse en experto
Cómo convertirse en expertoEnrique Diaz
 
¿Cómo implementar Admob en mi app Android?
¿Cómo implementar Admob en mi app Android?¿Cómo implementar Admob en mi app Android?
¿Cómo implementar Admob en mi app Android?Enrique Diaz
 
The future of mobile apps: Changing the world without staying off the bed
The future of mobile apps: Changing the world without staying off the bedThe future of mobile apps: Changing the world without staying off the bed
The future of mobile apps: Changing the world without staying off the bedEnrique Diaz
 

Mehr von Enrique Diaz (6)

Cómo convertirse en experto
Cómo convertirse en expertoCómo convertirse en experto
Cómo convertirse en experto
 
¿Cómo implementar Admob en mi app Android?
¿Cómo implementar Admob en mi app Android?¿Cómo implementar Admob en mi app Android?
¿Cómo implementar Admob en mi app Android?
 
Campus
Campus Campus
Campus
 
The future of mobile apps: Changing the world without staying off the bed
The future of mobile apps: Changing the world without staying off the bedThe future of mobile apps: Changing the world without staying off the bed
The future of mobile apps: Changing the world without staying off the bed
 
Android Basics
Android BasicsAndroid Basics
Android Basics
 
Android SDK intro
Android SDK introAndroid SDK intro
Android SDK intro
 

Kürzlich hochgeladen

EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveEPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveFagnerLisboa3
 
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfRedes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfsoporteupcology
 
Proyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptxProyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptx241521559
 
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)GDGSucre
 
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft FabricGlobal Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft FabricKeyla Dolores Méndez
 
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE  DE TECNOLOGIA E INFORMATICA PRIMARIACLASE  DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIAWilbisVega
 
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesKELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesFundación YOD YOD
 
Presentación guía sencilla en Microsoft Excel.pptx
Presentación guía sencilla en Microsoft Excel.pptxPresentación guía sencilla en Microsoft Excel.pptx
Presentación guía sencilla en Microsoft Excel.pptxLolaBunny11
 
Trabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnologíaTrabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnologíassuserf18419
 
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdftrabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdfIsabellaMontaomurill
 
Herramientas de corte de alta velocidad.pptx
Herramientas de corte de alta velocidad.pptxHerramientas de corte de alta velocidad.pptx
Herramientas de corte de alta velocidad.pptxRogerPrieto3
 
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...silviayucra2
 
guía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Josephguía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan JosephBRAYANJOSEPHPEREZGOM
 
9egb-lengua y Literatura.pdf_texto del estudiante
9egb-lengua y Literatura.pdf_texto del estudiante9egb-lengua y Literatura.pdf_texto del estudiante
9egb-lengua y Literatura.pdf_texto del estudianteAndreaHuertas24
 
pruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNITpruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNITMaricarmen Sánchez Ruiz
 

Kürzlich hochgeladen (15)

EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveEPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial Uninove
 
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfRedes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdf
 
Proyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptxProyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptx
 
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)
 
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft FabricGlobal Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
 
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE  DE TECNOLOGIA E INFORMATICA PRIMARIACLASE  DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
 
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesKELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento Protégeles
 
Presentación guía sencilla en Microsoft Excel.pptx
Presentación guía sencilla en Microsoft Excel.pptxPresentación guía sencilla en Microsoft Excel.pptx
Presentación guía sencilla en Microsoft Excel.pptx
 
Trabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnologíaTrabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnología
 
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdftrabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdf
 
Herramientas de corte de alta velocidad.pptx
Herramientas de corte de alta velocidad.pptxHerramientas de corte de alta velocidad.pptx
Herramientas de corte de alta velocidad.pptx
 
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
 
guía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Josephguía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Joseph
 
9egb-lengua y Literatura.pdf_texto del estudiante
9egb-lengua y Literatura.pdf_texto del estudiante9egb-lengua y Literatura.pdf_texto del estudiante
9egb-lengua y Literatura.pdf_texto del estudiante
 
pruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNITpruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNIT
 

Fragments, all you need to know for create multi-device apps.

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n