Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

O fantástico mundo de Android

3,303 views

Published on

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ❶❶❶ http://bit.ly/2F4cEJi ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ❶❶❶ http://bit.ly/2F4cEJi ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

O fantástico mundo de Android

  1. 1. O fantástico mundo de Android Suelen G. Carvalho
  2. 2. Quem sou eu www.SuelenGC.com.br | slideshare.net/suelengc
  3. 3. MULHERES15! ! ! Cupom especial para o dia das mulheres!! 15% de desconto
  4. 4. O que é o Android ?
  5. 5. Linguagem IDE www.developer.android.com ADT
  6. 6. Activity
  7. 7. Criar uma tela Activity SuaActivity
  8. 8. SuaActivity.java public class SuaActivity extends Activity { protected void onCreate (Bundle b) { super.onCreate(b); setContentView(R.layout.main_activity) ! // restante do seu código aqui… } } (comportamento) main_activity.xml <LinearLayout xmlns=“…” > <TextView android:layout_width=“wrap_content” android:layout_height=“wrap_content” android:text=“Olá Mundo!” … /> </LinearLayout> (view)
  9. 9. Olá Mundo!
  10. 10. Estrutura de diretórios resources ProjetoAgenda! src SuaActivity.java comportamento res layout main_activity.xml   drawable-mdpi! icon.jpg drawable-ldpi! view icon.jpg   values! ! ! strings.xml
  11. 11. Outras view's
  12. 12. Nome: <TextView…/> <EditText…/> Telefone: Nota: <RatingBar…/> Salvar <Button…/>
  13. 13. <LinearLayout xmlns=“…” > <EditText android:text=“Nome: “…/> <TextView…/> ! <EditText android:text=“Telefone: “…/> <TextView…/> ! <EditText android:text=“Nota: “…/> <RatingBar…/> ! <Button android:text=“Salvar“ android:id=“@+id/btn_salvar“…/> <!-- cotinua… --> </LinearLayout>
  14. 14. Comportamento ao botão public class SuaActivity extends Activity { protected void onCreate (Bundle b) { super.onCreate(b); setContentView(R.layout.main_activity) ! // Recupera o botão da tela Button salvar = (Button) findViewById(R.id.btn_salvar); ! //Adiciona comportamento ao botão salvar.setOnClickListener(new OnClickListener() { public void onClick(View view) { // COMPORTAMENTO AQUI… } }); } }
  15. 15. Ciclo de Vida da Activity
  16. 16. Ciclo de vida de uma Activity onCreate ! onStart ! onResume Android Kill onRestart onPause ! onStop ! onDestroy
  17. 17. Listas e Adapter's
  18. 18. Exibir uma lista Fulano Beltrano Ciclano
  19. 19. Adapter Fulano Beltrano Ciclano Fulano Beltrano Ciclano 0 1 2 Objetos (Java) View (xml)
  20. 20. public class SuaActivity extends Activity { protected void onCreate (Bundle b) { // código anterior… ! // Objetos Java String[] contatos = new String[]{“Fulano”, “Beltrano”, “Ciclano”}; ! // Adapter (java -> xml) ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, android.R.layout.simple_list_item_1, contatos); ! // Vincular adapter a lista ListView lista = (ListView) findViewById(R.id.lista); lista.setAdapter(adapter); } }
  21. 21. Banco de Dados
  22. 22. Criar um DAO SQLiteOpenHelper ContatoDAO
  23. 23. SQLiteOpenHelper public class ContatoDAO extends SQLiteOpenHelper { public void ContatoDAO(Context ctx) { super(ctx, “agenda", null, 1); } public void onCreate (SQLiteDataBase db) { String ddl = “create table contato (name text, telefone text);“; db.execSQL(ddl); } ! public void onUpgrade (SQLiteDataBase db) { // vamos deixar vazio por enquanto } }
  24. 24. Incluindo um contato public class ContatoDAO extends SQLiteOpenHelper { // código anterior… ! public void adiciona(Contato contato){ // insere contato no banco… ContentValues values = new ContentValues(); values(“nome”, contato.getNome()); values(“telefone”, contato.getTelefone()); ! getWritableDatabase().insert(“agenda”, null, values); } // apagar, atualizar e buscar aqui em breve ;) }
  25. 25. Apagando um contato public class ContatoDAO extends SQLiteOpenHelper { ! public void apaga(Contato contato){ String[] ids = {contato.getId().toString()}; getWritableDatabase().delete(“agenda”, “id=?”, ids); } ! }
  26. 26. Buscando os contatos public class ContatoDAO extends SQLiteOpenHelper { ! public List<Contato> busca(Contato contato){ List<Contato> contatos = new ArrayList<Contato>(); ! SQLiteDatabase database = getReadableDatabase(); Cursor cursor = database.rawQuery(“select * from agenda;”, null); ! while (cursor.moveToNext()) { Contato contato = criarContatoDo(cursor); contatos.add(contato); } return contatos; } }
  27. 27. Atualizando um contato public class ContatoDAO extends SQLiteOpenHelper { public void atualiza(Contato contato){ ContentValues values = new ContentValues(); values(“nome”, contato.getNome()); values(“telefone”, contato.getTelefone()); String[] ids = {contato.getId().toString()}; ! getWritableDatabase().update(“agenda”, values, id, ids); } }
  28. 28. Estou por aí se precisarem ;)

×