In this challenge, create a new function by extracting existing code, then move the function into a new class in a different package.
(upbeat electronic music) … - [Instructor] Here's a simple challenge … to test your understanding of how to modify code … in Android Studio. … First, create a new Android Studio project, … and I'll use a template I haven't used before … in this course. … It'll be based on an activity template … labeled Scrolling Activity. … I'll name the new project Scrolling Activity, … and then create it. … When this project opens, you'll see … the Scrolling Activity class. … Now here's the very simple goal. … That there's a bit of code in the onCreate function. … Your job is to extract that code … and place it into its own function. … Call the function InitLayout. … When you're done, you should have a new function … named InitLayout that has all this code, … and you should also have a call to that new function … in the onCreate function. … Don't do this manually, … use Android Studio's refactoring tools … to extract the code to a new function. … When you're done, take a look at the next video, … and I'll show you my solution. …
- Installing Android Studio on macOS and Windows
- Creating your first project
- Creating virtual devices for testing
- Version control with GitHub
- Customizing the Android Studio interface
- Managing dependencies
- Generating and editing Kotlin code
- Refactoring and inspecting code
- Using templates
- Analyzing and debugging code
- Managing bitmap and vector images
Skill Level Beginner
What you should know1m 47s
1. Getting Started
2. Get Ready to Develop Apps
3. Use Software Version Control
Clone a GitHub repository3m 35s
4. Explore the User Interface
5. Manage Project Builds and Dependencies
6. Create and Edit Code Files
7. Analyze and Debug Your Code
8. Manage Image Files
Create vector image assets3m 50s
Next steps1m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.