“some info to send”); startActivity(intent); ActivityB protected void onCreate(Bundle savedInstanceState) { … String data = getIntent().getStringExtra(“key"); // data = “some info to send”
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
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)
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)
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()
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!
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
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)