Creating PhotoGallery

Create a new Android application project. As you have done before, choose Phone and Tablet as the target form factor and select the option to add no activity. Name the project PhotoGallery. Make sure the Package name is com.bignerdranch.android.photogallery, the Language is Kotlin, and the Minimum API level is API 21: Android 5.0 (Lollipop). Check the box to Use AndroidX artifacts.

Once the project has initialized, click on app in the project tool window and add an empty activity (FileNewActivityEmpty Activity) named PhotoGalleryActivity. Check the box to make PhotoGalleryActivity a Launcher Activity.

PhotoGalleryActivity will host a PhotoGalleryFragment, which you will create shortly. First, open

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.