$30 off During Our Annual Pro Sale. View details »

Intro to Android in 4 days

Intro to Android in 4 days

Training for really basic Android concepts, way back in 2015.

Andrei Diaconu

December 17, 2015
Tweet

More Decks by Andrei Diaconu

Other Decks in Technology

Transcript

  1. Android Intro Vrei sa fii miliardar edition

  2. 4 zile 1. Setup + 1 Buton 2. Tipuri de

    layout 3. Activitati 4. Salvarea datelor
  3. Ziua 1 1. Setup Android Studio 2. Terminologie POO 3.

    Structura fisiere 4. XML Layout 5. Java
  4. https://developer.android.com/sdk/index.html

  5. None
  6. • Clasa • Obiect • Atribut • Metoda • Parametru

  7. • Android Manifest • Resurse Android • Layout • Drawable

    • Values • Java
  8. Layout

  9. Layout

  10. Java

  11. Ziua 2 • width, height • Tipuri de ViewGroup •

    Layout-ul jocului nostru
  12. Abc wrap_content Abc match_parent Ab 50px

  13. LinearLayout

  14. Abc Bcdef Gol

  15. A B

  16. A

  17. A B

  18. RelativeLayout

  19. id view-ul pozitionat

  20. ViewGroup • LinearLayout • RelativeLayout • FrameLayout • TableLayout •

    GridLayout • PercentFrameLayout, PercentRelativeLayout ?
  21. Intrebare Raspuns Raspuns Raspuns Raspuns

  22. Intrebare luuungaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa Raspuns Raspuns

  23. Ziua 3 1. Populam ecranul cu date 2. Activitate de

    final de joc 3. Intenturi intre activitati
  24. Intent • actiune • parametri

  25. Intent • explicite • implicite

  26. context.startActivity(intent)

  27. Intent explicit • Intent i = new Intent(context, FinalActivity.class); •

    i.putExtra("key","value"); • startActivity(i);
  28. Exemple implicite • ACTION_VIEW • ACTION_SEND

  29. ACTION_VIEW • Intent i = new Intent(Intent.ACTION_VIEW); • i.setData(Uri.parse("http://google.com")); •

    startActivity(i);
  30. ACTION_SEND • Intent i = new Intent(Intent.ACTION_SEND); • i.putExtra(Intent.EXTRA_SUBJECT, "Subject

    Here"); • i.putExtra(Intent.EXTRA_TEXT, "A body"); • startActivity(i);
  31. Practica • Ecran de final • Validarea raspunsurilor • Legam

    intrebarile intre ele • Inchidem ecranele din urma
  32. Ziua 4 • Shared Preferences • Un ecran de start

    • Numar de castiguri si pierderi • Extra
  33. Shared Preferences • getSharedPreferences ("nume_fisier", MODE_PRIVATE)

  34. Salvarea datelor • editor = sharedPreferences.edit() • editor.putInt("numar_castiguri", 5) •

    editor.apply()
  35. Citirea datelor • sharedPreferences.getInt("numar_castiguri",0)

  36. Extra: Portret / Landscape • Calificatori de resurse • land

    vs port • Practica
  37. Extra: resurse online • AsyncTask<> • Permisiuni android INTERNET •

    URL.openStream()
  38. Keep in touch • https://www.facebook.com/ITst.Iasi • https://www.facebook.com/groups/androidiasi/