VOOZH about

URL: https://www.geeksforgeeks.org/android/how-to-build-a-book-library-app-using-google-books-api-in-android/

⇱ How to Build a Book Library App using Google Books API in Android? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Build a Book Library App using Google Books API in Android?

Last Updated : 23 Jul, 2025

If you are looking for building a book library app and you want to load a huge data of books then for adding this feature, you have to use a simple API which is provided by Google, and of course, it's free. In this article, we will take a look at the implementation of this API in our Android App. 

What we are going to build in this article? 

We will be building a simple application in which we will be searching different types of books and we will get to see the list of books related to that topic in our RecyclerView. For searching these books we will be using a free API provided by Google which holds a huge collection of books. A sample video is given below to get an idea about what we are going to do in this article.

Note that we are going to implement this project using the Java language. 

Step by Step Implementation

Step 1: Create a New Project

To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio.

Step 2: Add the dependency for Volley in your Gradle files

Navigate to the app > Gradle Scripts > build.gradle.kts (Module :app) file and add below dependency in the dependencies section. 

dependencies {
 ...
 implementation("com.android.volley:volley:1.2.1")
 implementation("com.github.bumptech.glide:glide:4.16.0")
}

After adding the below dependencies in your gradle file now sync your project. As we will be using volley to fetch data from our API and Glide image loading library to load images from URL.

Step 3: Adding permissions for the Internet 

Navigate to the app > manifests > AndroidManifest.xml and add the below permissions to it. 

<uses-permission android:name="android.permission.INTERNET" />

As we will be loading the books from API so we have to request Internet permissions from the user. For that add the permissions for the internet in AndroidManifest.xml


Step 4: Working with the activity_main.xml and its sub layout

Go to the activity_main.xml file and refer to the following code. Now, create a new layout for each item of the recyclerview and name it book_rv_item.xml. Remember to add a drawable for the search button.

The xml code is given below.


Step 5: Creating a Modal Class for storing our data from the API. 

For creating a new Modal class. Navigate to the app > java > {package-name}, Right-click on it and Click on, New > Java/Kotlin class and give a name to our file as BookInfo and add below code to it. Comments are added in the code to get to know in more detail.


Step 7: Creating an Adapter class for setting our data to the item of RecyclerView

Navigate to the app > java > {package-name}, Right-click on it and Click on, New > Java/Kotlin class and name it as BookAdapter and add below code to it. Comments are added in the code to get to know in more detail. 


Step 8: Creating a new Activity for displaying our Book Info in detail 

Navigate to the app > java > your app's package name > Right-click on it and click on New > Activity > Select Empty Activity and name it as BookDetails. Make sure to select Empty Activity. Go to the activity_book_details.xml and BookDetails.kt/.java file and refer to the following code.


Step 9: Working with the MainActivity file

Go to the MainActivity.java/.kt file and refer to the following code. Below is the code for the MainActivity file. Comments are added inside the code to understand the code in more detail.

Check out the project on the below link:Book-Library-App-using-Google-Books-API

Output:


Comment

Explore