

How could it be better than the tried and tested ListView and GridView? The answers are in the details. However, in a RecyclerView, there are features that separate your code into maintainable components even as they enforce memory-efficient design patterns.

A RecyclerView can be thought of as a combination of a ListView and a GridView. Consider the next section your mission brief.Īndroid used to use ListView or GridView classes for displaying lists. You’re about to explore the vastness of RecyclerViews, and no competent commander heads into the unknown without preparation. Paste the API key into the api_key string resource, replacing INSERT API KEY HERE: Next, copy the API key and open the strings.xml file in your project. To get a key, put your name and email address into and copy the API key that appears on the screen or in your email. To use the Astronomy Picture of the Day API, one of NASA’s most popular web services, you need an API key.

It’s empty! Before adding NASA’s amazing astrophotography, you need to do some set up. Click the Run app button at the top and you’ll see this: Get the starter project using the Download Materials at the top or bottom of this tutorial and open it in Android Studio. Review our introductory tutorials for a refresher! Getting Started Prerequisite note: You’ll need Android Studio 3.0 or greater and a working knowledge of developing for Android with Kotlin before starting this tutorial.
