Creating BeatBox

Time to get started. The first step is to create your BeatBox app.

In Android Studio, select FileNewNew Project... to create a new project. Start with the Empty Activity option for Phone and Tablet. Call this app BeatBox and give it a package name of com.bignerdranch.android.beatbox. Select the option to Use AndroidX artifacts and leave the rest of the defaults as they are.

The activity will display a grid of buttons in a RecyclerView. Add the androidx.recyclerview:recyclerview:1.0.0 dependency to your app/build.gradle file (do not forget to sync the file). Replace the autogenerated contents of res/layout/activity_main.xml with a single RecyclerView.

Listing 19.1  Updating the layout file for MainActivity ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.