[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013

Download [FLISOL] Android Faixa Branca (Iniciando no Android) – 2013

Post on 01-Sep-2014

322 views

Category:

Technology

3 download

Embed Size (px)

DESCRIPTION

Palestra ministrada no FLISOL Campinas 2013

TRANSCRIPT

<ul><li> Android Faixa Branca Douglas Drumond! drumond.douglas@gmail.com eee19.com </li> <li> eu.about() eee19.com </li> <li> eu.about() Bacharel em Cincia da Computao eee19.com </li> <li> eu.about() Bacharel em Cincia da Computao Analista de software no Instituto de Pesquisas Eldorado eee19.com </li> <li> eu.about() Bacharel em Cincia da Computao Analista de software no Instituto de Pesquisas Eldorado Scio e co-fundador da Y-MAX Consultoria em TI eee19.com </li> <li> eu.about() Bacharel em Cincia da Computao Analista de software no Instituto de Pesquisas Eldorado Scio e co-fundador da Y-MAX Consultoria em TI Organizador do GDG Campinas eee19.com </li> <li> @Eldorado Aplicaes Framework Bibliotecas Dalvik Linux Kernel eee19.com </li> <li> @Eldorado Aplicaes Framework Bibliotecas Linux Kernel Dalvik BP eee19.com </li> <li> Hoje http://www.ickr.com/photos/natalielucier/3619749009/ eee19.com </li> <li> http://www.ickr.com/photos/donkeyhotey/5666071828/ eee19.com </li> <li> Ferramentas eee19.com </li> <li> Pr-requisitos JDK! Android SDK eee19.com </li> <li> Sistema Operacional Linux! Mac OS X (Intel)! Windows XP ou superior eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas Remote debugger logcat DDMS eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Ferramentas eee19.com </li> <li> Livre the denition of open: "mkdir android ; cd android ; repo init -u git:// android.git.kernel.org/platform/manifest.git ; repo sync ; make" http://twitter.com/#!/arubin/status/27808662429 eee19.com </li> <li> Arquitetura eee19.com </li> <li> Arquitetura Linux Kernel eee19.com </li> <li> Arquitetura Bibliotecas Dalvik Linux Kernel eee19.com </li> <li> Arquitetura Framework Bibliotecas Dalvik Linux Kernel eee19.com </li> <li> Arquitetura Aplicaes Framework Bibliotecas Dalvik Linux Kernel eee19.com </li> <li> Arquitetura Aplicaes Framework Bibliotecas Dalvik Linux Kernel eee19.com </li> <li> Dissecando as Aplicaes eee19.com </li> <li> Activity eee19.com </li> <li> Service eee19.com </li> <li> Content Provider eee19.com </li> <li> Intent eee19.com </li> <li> Intent eee19.com </li> <li> Intent eee19.com </li> <li> Intent eee19.com </li> <li> Intent eee19.com </li> <li> Broadcast Receiver No possui interface (com usurio)! Roda em segundo plano! Reage a mensagens de broadcast! Exemplo: carga de bateria eee19.com </li> <li> Activity Interface! Um objetivo! Vrias por aplicativo! Pode iniciar outras activities eee19.com </li> <li> Activity 3 estados: ativa, em pausa e parada! 3 ciclos de vida! pode morrer a qualquer momento se no estiver ativa eee19.com </li> <li> Activity eee19.com </li> <li> Activity onCreate() eee19.com </li> <li> Activity onCreate() onStart() eee19.com </li> <li> Activity onCreate() onStart() onResume() eee19.com </li> <li> Activity onCreate() onStart() onResume() em execuo eee19.com </li> <li> Activity onCreate() onStart() onResume() em execuo onPause() eee19.com </li> <li> Activity onCreate() onStart() onResume() em execuo onPause() eee19.com </li> <li> Activity onCreate() onStart() Primeiro plano onResume() em execuo onPause() eee19.com </li> <li> Activity onCreate() onStart() Primeiro plano onResume() em execuo onPause() onStop() eee19.com </li> <li> Activity onCreate() onStart() Primeiro plano onRestart() onResume() em execuo onPause() onStop() eee19.com </li> <li> Activity onCreate() onStart() Primeiro plano onRestart() onResume() em execuo onPause() onStop() eee19.com </li> <li> Activity onCreate() Visvel onStart() Primeiro plano onRestart() onResume() em execuo onPause() onStop() eee19.com </li> <li> Activity onCreate() Visvel onStart() Primeiro plano onRestart() onResume() em execuo onPause() onStop() onDestroy() eee19.com </li> <li> Activity onCreate() Visvel onStart() Primeiro plano onRestart() onResume() em execuo onPause() onStop() onDestroy() shutdown eee19.com </li> <li> Activity Ciclo de vida completo onCreate() Visvel onStart() Primeiro plano onRestart() onResume() em execuo onPause() onStop() onDestroy() shutdown eee19.com </li> <li> Multitarefa eee19.com </li> <li> Multitarefa eee19.com </li> <li> Multitarefa onCreate() eee19.com </li> <li> Multitarefa onPause() eee19.com </li> <li> Multitarefa eee19.com </li> <li> Multitarefa onResume() eee19.com </li> <li> Multitarefa onPause() eee19.com </li> <li> Multitarefa onStop() eee19.com </li> <li> Multitarefa onStop() onCreate() eee19.com </li> <li> Multitarefa onStop() onCreate() onPause() eee19.com </li> <li> Multitarefa onStop() onCreate() onPause() onStop() eee19.com </li> <li> Multitarefa onStop() onCreate() onPause() onStop() eee19.com </li> <li> Multitarefa onStop() onCreate() onCreate() onPause() onStop() eee19.com </li> <li> Multitarefa onStop() onCreate() onRestart() onPause() onStop() onCreate() eee19.com </li> <li> Multitarefa onStop() onCreate() onRestart() onPause() onStart() onStop() onCreate() eee19.com </li> <li> Prtica Criar uma aplicao com os mtodos onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy() e onRestart()! Colocar logs nesses mtodos e observar o que acontece eee19.com </li> <li> UI Hierarquia de ViewGroups e Views eee19.com </li> <li> View Group View Group View View View View View http://developer.android.com/guide/topics/ui/overview.html eee19.com </li> <li> Layout http://developer.android.com/ eee19.com </li> <li> Layout public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_layout); } Button myButton = (Button) findViewById(R.id.my_button); http://developer.android.com/ eee19.com </li> <li> Layout FrameLayout! LinearLayout! TableLayout! RelativeLayout eee19.com </li> <li> Eventos Denir um listener e registr-lo com a View! Sobrecarregar um mtodo de callback na View eee19.com </li> <li> Listeners onClick() View.OnClickListener! onLongClick() View.OnLongClickListener! onFocusChange() View.OnFocusChangeListener! onKey() View.OnKeyListener! onTouch() View.OnTouchListener! onCreateContextMenu() View.OnCreateContextMenuListener eee19.com </li> <li> Listeners // Create an anonymous implementation of OnClickListener private OnClickListener mCorkyListener = new OnClickListener() { public void onClick(View v) { // do something when the button is clicked } }; ! protected void onCreate(Bundle savedValues) { ... // Capture our button from layout Button button = (Button)findViewById(R.id.corky); // Register the onClick listener with the implementation above button.setOnClickListener(mCorkyListener); http://developer.android.com/ ... } eee19.com </li> <li> Listeners public class ExampleActivity extends Activity implements OnClickListener { protected void onCreate(Bundle savedValues) { ... Button button = (Button)findViewById(R.id.corky); button.setOnClickListener(this); } ! // Implement the OnClickListener callback public void onClick(View v) { // do something when the button is clicked } ... http://developer.android.com/ } eee19.com </li> <li> Intents Comunicao intra e inter app de um jeito amigvel e inteligente! Serve para iniciar activities, services e broadcast receivers eee19.com </li> <li> Intents Possui um alvo facultativo! Se no tiver especicado alvo, o sistema encontra um! Pode executar uma Activity ou Service especco! IntentFilters eee19.com </li> <li> Intents Component name! Action! Data! Category! Extras! Flags eee19.com </li> <li> Intents Constante Alvo Ao ACTION_CALL activity Inicia uma ligao ACTION_EDIT activity Apresenta dados a serem editados ACTION_MAIN activity Activity inicial ACTION_SYNC activity Sincroniza dados com servidor ACTION_BATTERY_LOW broadcast receiver Aviso de bateria fraca ACTION_HEADSET_PLUG broadcast receiver Um fone de ouvido foi conectado ou desconectado ACTION_SCREEN_ON broadcast receiver A tela foi ligada (acesa) ACTION_TIMEZONE_CHANGED broadcast receiver Conguraes de timezone modicadas eee19.com </li> <li> Intent lter . . . . . . http://developer.android.com/ eee19.com </li> <li> http://developer.android.com/! ! http://developer.android.com/ training/index.html! eee19.com </li> <li> Obrigado Twitter/ADN @douglasdrumond! www.eee19.com! gplus.to/douglasdrumond eee19.com </li> </ul>