Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile App Design - Lab 6 (Android)

Caren
October 30, 2018
180

Mobile App Design - Lab 6 (Android)

Caren

October 30, 2018
Tweet

Transcript

  1. What are things we might need to know in order

    to build a popular Android app? Show data (text, images, videos) Lab 2: Create content and take users through different flows Save data Look nice!
  2. Flashcard App : Lab 2 Android uses Intent objects to

    specify what it wants to happen (ie : start a new Activity)
  3. Flashcard App : Lab 2 Android uses Intent objects to

    specify what it wants to happen (ie : start a new Activity) Intent objects can also contain data to be passed to other Activities
  4. Android Intents ActivityA Intent intent = new Intent(ActivityA.this, ActivityB.class); intent.putExtra(“key",

    “some info to send”); startActivity(intent); ActivityB protected void onCreate(Bundle savedInstanceState) { … String data = getIntent().getStringExtra(“key"); // data = “some info to send”
  5. Flashcard App : Lab 2 Android uses Intent objects to

    specify what it wants to happen (ie : start a new Activity) Intent objects can also contain data to be passed to other Activities When you launch a new activity, you can also specify that you want to wait for data to come back when the activity finishes
  6. Flashcard App : Lab 2 Android uses Intent objects to

    specify what it wants to happen (ie : start a new Activity) Intent objects can also contain data to be passed to other Activities When you launch a new activity, you can also specify that you want to wait for data to come back when the activity finishes
 startActivityForResult(intent, 100)
 
 onActivityResult(int requestCode, int resultCode, Intent data)
  7. What are things we might need to know in order

    to build a popular Android app? Show data (text, images, videos) Create content and take users through different flows Lab 3 : Save data Look nice!
  8. Databases Databases are basically structured data stored in “table” form

    Applications can interact with databases to:
 Create data
 Read data
 Update data
 Delete data
  9. Room Room is an Android library that let’s us easily

    interact with our app’s database
  10. Room Room is an Android library that let’s us easily

    interact with our app’s database Usually when interacting with databases, we have to write code like …
 SELECT * FROM Students
 (Students is the name of the table, and this query gets all entries in the Students table)
  11. Room Room is an Android library that let’s us easily

    interact with our app’s database Usually when interacting with databases, we have to write code like …
 SELECT * FROM Students
 (Students is the name of the table, and this query gets all entries in the Students table) With Room, we can write code like …
 database.getAllStudents()
  12. Libraries Developers can save a lot of time by using

    libraries to simplify their code
  13. Libraries Developers can save a lot of time by using

    libraries to simplify their code For example, if we wanted to make network calls to get data from the internet, we can either:
 1) write a ton of code to make the network calls 
 or
 2) use a library that already has all the functions we need!
  14. Gradle Gradle is Android’s build system, meaning it’s how Android

    Studio takes a bunch of files to produce an APK (or app)
  15. Gradle Gradle is Android’s build system, meaning it’s how Android

    Studio takes a bunch of files to produce an APK (or app) Gradle is how Android projects manage their libraries
  16. Gradle Gradle is Android’s build system, meaning it’s how Android

    Studio takes a bunch of files to produce an APK (or app) Gradle is how Android projects manage their libraries Every app has a build.gradle file, and this is where we define the libraries we want to use for our app
  17. Working on Labs Questions?
 1. Ask for help from group

    members
 2. Ask for TA help through the android specific Slack channel Only Required features need to be implemented, but if you have extra time, explore the optionals! Due date for the lab is midnight next Friday (Nov 16)