Curso android - Secomp2011
-
Upload
yuri-adams -
Category
Documents
-
view
624 -
download
0
Transcript of Curso android - Secomp2011
![Page 1: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/1.jpg)
Curso Android – SECOMP 2011
Yuri Adams Chaves Maia
Twitter: @yuriadams
![Page 2: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/2.jpg)
#whoami
• Yuri Adams Chaves Maia
• Graduando em C.Computação – UECE
• Estagiário – TriadWorks
• Twitter: @yuriadams
• Email 1: [email protected]
• Email 2: [email protected]
• Blog: yuriadamsmaia.wordpress.com
![Page 3: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/3.jpg)
#topicos• Helloworld• Teoria• Activity• Componentes de tela• Layouts• Eventos• Menus
– ContextMenus
• Persistência com SQLite• Intents(Interação entre páginas, Câmera, Sms, … )• Mapas• Broadcast Receivers
![Page 4: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/4.jpg)
#ambiente
• Android SDK -http://developer.android.com/sdk/index.html
• Eclipse IDE -http://www.eclipse.org/downloads/
• Plugin ADT(Android Developers Tools) para o Eclipse -http://developer.android.com/sdk/eclipse-adt.html
![Page 5: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/5.jpg)
#ambiente
![Page 6: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/6.jpg)
#ambiente
![Page 7: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/7.jpg)
#ambiente
![Page 8: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/8.jpg)
#ambiente
![Page 9: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/9.jpg)
#ambiente
![Page 10: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/10.jpg)
#ambiente
![Page 11: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/11.jpg)
#helloworld
![Page 12: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/12.jpg)
#helloworld
![Page 13: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/13.jpg)
#helloworld
![Page 14: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/14.jpg)
#helloworld
![Page 15: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/15.jpg)
#helloworld
![Page 16: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/16.jpg)
#helloworld
![Page 17: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/17.jpg)
#helloworld
![Page 18: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/18.jpg)
#helloworld
![Page 19: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/19.jpg)
#helloworld
![Page 20: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/20.jpg)
#teoria
![Page 21: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/21.jpg)
#teoria
![Page 22: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/22.jpg)
#teoria
• Services
– onResume(), onPause(), onStop() noWay!!
![Page 23: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/23.jpg)
#teoria
• Receptores de Broadcast
• Widgets
• Notifications
![Page 24: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/24.jpg)
#iniciando
• Criar nosso Projeto (agenda, etc.)
• Criar nosso xml
• Criar nossos componentes na tela.
• “Bindar” os componentes com o xml.
• Criar eventos de Clique.
• Criar Menus.
• Chamando Activity’s
![Page 25: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/25.jpg)
#persistencia
• SQLite
• Criar nossoModel(id,nome,telefone,endereço,foto)
• Criar nosso DAO(extends SQLiteOpenHelper)
• Criar métodos do CRUD
• Criar Tela de Formulário
• Add os métodos e os eventos na Activity.
![Page 26: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/26.jpg)
#Intents
• Câmera
• startActivityForResult(intent);
• Guardar as Fotos no SD CARD
• Add evento ao button no Formulario.java
• Carregar a Imagem
• Gerar o Bitmap
![Page 27: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/27.jpg)
#Intents
• Ligando para o “Contato”
• Criar “Context Menu”
– onCreateContextMenu
– onContextItemSelected
– Criar Intent para a chamada
![Page 28: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/28.jpg)
#Intents
• Enviando SMS– Criar Context Menu
– Criar opção do Item selecionado
– Chamando a Intent
• Me achando no Mapa– Criar Context Menu
– Criar opção do Item selecionado
– Chamando de novo a Intent
![Page 29: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/29.jpg)
#inflandoAListView
• Override onResume()
• carregaLista()
• setAdapter()
![Page 30: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/30.jpg)
#mapas
• *Google API Key
• Criar View (xml)
• Add na View
• Criar Activity (MapActivity)
![Page 31: Curso android - Secomp2011](https://reader033.fdocument.pub/reader033/viewer/2022060201/559aeaac1a28ab724e8b480c/html5/thumbnails/31.jpg)
#BroadcastReceiver
• SMSReceiver
• Criar o método isAluno no ContatoDAO
• Lógica: Se a msg recebida for de um contato, toca um mp3.