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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.