SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
MANEJO DE LA
                                      CAMARA
                                       PHONEGAP VS ANDROID



                          Ana Cecilia Castillo (ceci@girlsattech.org)
                                            @zezzi
Sunday, February 19, 12
CAMARA EN ANDROID
                    •     DOS FORMAS DE ACCESAR LA CAMARA:
                            1) CAMERA API : Si se esta contruyendo la aplicación completa de la
                                camara
                            II) CAMERA INTENT: Utiliza la aplicación de la camara del telefono




                    •     Soporta 2 Modelos
                             I) Thumbnail: Por default se genera y para obtenerlo se encuentra en el
                          parametro data en onActivityResult() se obtiene usando getParcelableExtra()

                             II)Full Image: Se puede establecer en donde se guardara usando
                                    Media Store.EXTRA_OUTPUT




Sunday, February 19, 12
USANDO CAMERA INTENT
                    • Crear el Camera Inten Usando:
                             MediaStore.ACTION_IMAGE_CAPTURE

                             MediaStore.ACTION_VIDEO_CAPTURE


                    • Darle start al Camera Intent
                            startActivityForResult()


                    • Recibir el Intent Result
                            Crear el metodo onActivityResult()




Sunday, February 19, 12
USANDO CAMERA API
                    •     Detectar y accesar la Camara

                    •     Crear una Preview Class : se encarga del live
                          preview de la Imagen

                    •     Crear un Preview Layout

                    •     Crear los listeners para la captura

                    •     Capturar y guardar la Imagen

                    •     Liberar la Camara


Sunday, February 19, 12
OPCIONES DE CAMERA API

                    •     SceneMode

                    •     FlashMode

                    •     WhiteBalance

                    •     ColorEffect

                    •     FocusMode

                    •     Calidad de la Imagen

                    •     Frame Rate


Sunday, February 19, 12
PERMISOS
                    •     Le damos Permiso a la aplicación de utilizar la
                          camara Si utilizamos la Opcion de utilizar el
                          Camera API


                    •     Si nuestra aplicación guardara las Imagenes en el
                          external Storage(SD Card)




Sunday, February 19, 12
Ejemplo:
                           Codigo de @ykro
                          h"ps://github.com/androidMDW/
                                   guia3completo



Sunday, February 19, 12
Cultura
                          Android
                          Guatemala

Sunday, February 19, 12
CAMERA API
                    • navigator.camera.getPicture(cameraSucess,c
                          ameraErro,[cameraOptions]);
                    • Source Types que tenemos:




Sunday, February 19, 12
CAMERA API

                    • El Resultado lo obtenemos de dos maneras
                               I)String que contiene la imagen encodeada
                                  en Base 64 (No muy recomendado)
                              II)String que representa la localizacion
                                 de la imagen.

                    •     LocalStorage, RemoteServer, Render It




Sunday, February 19, 12
CAMERA OPTIONS
                    •     Quality: Calidad de Imagen al momento de
                          guardarse 0-100

                    •     DestinationType : DATA_URL, FILE_URI

                    •     SourceType:
                          PHOTOLIBRARY,CAMERA,SAVEDPHOTOALBUM

                    •     AllowEdit

                    •     JPEG, PNG

                    •     TargetWidth, TargetHeight


Sunday, February 19, 12
CAMERA OPTIONS




Sunday, February 19, 12
EJEMPLO
                              :)


Sunday, February 19, 12
PREGUNTAS
                            Ana Cecilia Catillo
                           ceci@girlsattech.org
                                 @zezzi




Sunday, February 19, 12

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Manejo de cámara en PhoneGap vs Android

  • 1. MANEJO DE LA CAMARA PHONEGAP VS ANDROID Ana Cecilia Castillo (ceci@girlsattech.org) @zezzi Sunday, February 19, 12
  • 2. CAMARA EN ANDROID • DOS FORMAS DE ACCESAR LA CAMARA: 1) CAMERA API : Si se esta contruyendo la aplicación completa de la camara II) CAMERA INTENT: Utiliza la aplicación de la camara del telefono • Soporta 2 Modelos I) Thumbnail: Por default se genera y para obtenerlo se encuentra en el parametro data en onActivityResult() se obtiene usando getParcelableExtra() II)Full Image: Se puede establecer en donde se guardara usando Media Store.EXTRA_OUTPUT Sunday, February 19, 12
  • 3. USANDO CAMERA INTENT • Crear el Camera Inten Usando: MediaStore.ACTION_IMAGE_CAPTURE MediaStore.ACTION_VIDEO_CAPTURE • Darle start al Camera Intent startActivityForResult() • Recibir el Intent Result Crear el metodo onActivityResult() Sunday, February 19, 12
  • 4. USANDO CAMERA API • Detectar y accesar la Camara • Crear una Preview Class : se encarga del live preview de la Imagen • Crear un Preview Layout • Crear los listeners para la captura • Capturar y guardar la Imagen • Liberar la Camara Sunday, February 19, 12
  • 5. OPCIONES DE CAMERA API • SceneMode • FlashMode • WhiteBalance • ColorEffect • FocusMode • Calidad de la Imagen • Frame Rate Sunday, February 19, 12
  • 6. PERMISOS • Le damos Permiso a la aplicación de utilizar la camara Si utilizamos la Opcion de utilizar el Camera API • Si nuestra aplicación guardara las Imagenes en el external Storage(SD Card) Sunday, February 19, 12
  • 7. Ejemplo: Codigo de @ykro h"ps://github.com/androidMDW/ guia3completo Sunday, February 19, 12
  • 8. Cultura Android Guatemala Sunday, February 19, 12
  • 9. CAMERA API • navigator.camera.getPicture(cameraSucess,c ameraErro,[cameraOptions]); • Source Types que tenemos: Sunday, February 19, 12
  • 10. CAMERA API • El Resultado lo obtenemos de dos maneras I)String que contiene la imagen encodeada en Base 64 (No muy recomendado) II)String que representa la localizacion de la imagen. • LocalStorage, RemoteServer, Render It Sunday, February 19, 12
  • 11. CAMERA OPTIONS • Quality: Calidad de Imagen al momento de guardarse 0-100 • DestinationType : DATA_URL, FILE_URI • SourceType: PHOTOLIBRARY,CAMERA,SAVEDPHOTOALBUM • AllowEdit • JPEG, PNG • TargetWidth, TargetHeight Sunday, February 19, 12
  • 13. EJEMPLO :) Sunday, February 19, 12
  • 14. PREGUNTAS Ana Cecilia Catillo ceci@girlsattech.org @zezzi Sunday, February 19, 12