Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:37:07+00:00 2026-05-22T15:37:07+00:00

i have developed an application in which i fetch books using googleapibook search. I

  • 0

i have developed an application in which i fetch books using googleapibook search. I have an isbn no. Now i want to let my user read that book page by page. But i didn’t find any method or solution to read book in java or android.

Here is my code.

package com.project.bookhunt;

import java.net.URL;
import java.util.ArrayList;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.json.JSONArray;
import org.json.JSONObject;

import android.content.Context;
import android.widget.Toast;

public class BookSearchParser 
{
    Context m_context;
    static ArrayList<Book_Item> books= new ArrayList<Book_Item>();
    String searchResult;
    BookSearchParser(Context c,URL url)
    {
        try
        {

           m_context=c;
           HttpClient client = new HttpClient();

           GetMethod getMethod = new GetMethod(url.toString());
           int statusCode = client.executeMethod(getMethod);
           System.out.println("status Code"+statusCode);
           System.out.println(getMethod.getResponseBodyAsString());
           searchResult=getMethod.getResponseBodyAsString();
           parseJSON(searchResult);
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

    public static ArrayList<Book_Item> getBooks()
    {
        return books;
    }

    private void parseJSON(String object)
     {
         try
         {
         books=new ArrayList<Book_Item>();
         JSONObject jSonObject = new JSONObject(object);
         if(jSonObject.getInt("totalItems")>0)
         {
             JSONArray jSonObjectArray = jSonObject.getJSONArray("items");
             for(int count = 0; count < jSonObjectArray.length();count++)
             {  
                    Book_Item item=new Book_Item();
                    JSONObject jsonItem = (JSONObject) jSonObjectArray.get(count);

                    if(jsonItem.has(("id")))
                    {
                        item.setId(jsonItem.getString("id"));   
                    }
//                  else
//                  {
//                      item.setId("No Id");
//                  }


                    if(jsonItem.has("selfLink"))
                    {
                      item.setSelfLink(jsonItem.getString("selfLink"));

                    }
//                  else
//                  {
//                      item.setSelfLink("No Link Avilable");
//                  }



                        if(jsonItem.has("volumeInfo"))
                        {
                             JSONObject volumeInfo = (JSONObject)jsonItem.get("volumeInfo");

                                if(volumeInfo.has("title"))
                                {
                                    item.setTitle(volumeInfo.getString("title"));
                                }
//                              else
//                              {
//                                  item.setTitle("No Title");
//                              }


                                if(volumeInfo.has("subtitle"))
                                {
                                    item.setSubTitle(volumeInfo.getString("subtitle"));
                                }
//                              else
//                              {
//                                  item.setSubTitle("No SubTitle Avilable");
//                              }
//                              
                                    if(volumeInfo.has("authors"))
                                    {
                                         JSONArray Authors = volumeInfo.getJSONArray("authors");
                                            for(int authorCount=0;authorCount<Authors.length();authorCount++)
                                            {
                                                    item.setAuthor(Authors.getString(authorCount));         
                                            }
                                    }



                                  if(volumeInfo.has("description"))
                                  {
                                      item.setDiscription(volumeInfo.getString("description"));
                                  }
//                                else
//                                {
//                                    item.setDiscription("No Description Avilable");
//                                }

                                  if(volumeInfo.has("averageRating"))
                                  {
                                      item.setRating(volumeInfo.getString("averageRating"));
                                  }


                                  if(volumeInfo.has("industryIdentifiers"))
                                  { 
                                      JSONArray isbnArray = volumeInfo.getJSONArray("industryIdentifiers");


                                            for(int isbnCount=0;isbnCount<isbnArray.length();isbnCount++)
                                            {
                                                JSONObject isbn=(JSONObject)isbnArray.get(isbnCount);
                                                if(isbn.getString(("type")).equals("ISBN_10"))
                                                {
                                                    item.setIsbn10(isbn.getString("identifier"));
                                                }
                                                if(isbn.getString(("type")).equals("ISBN_13"))
                                                {
                                                    item.setIsbn13(isbn.getString("identifier"));
                                                }

                                            }

                                  }

                                if(volumeInfo.has("categories"))
                                {
                                      JSONArray categoriesArray = volumeInfo.getJSONArray("categories");

                                        for(int j=0;j<categoriesArray.length();j++)
                                        {
                                            item.setCategory(categoriesArray.getString(j));                 
                                        }
                                }
//                              else
//                              {
//                                  item.setCategory("No category");
//                              }
//                              


                                if(volumeInfo.has("imageLinks"))
                                {
                                    JSONObject ImageLinks = volumeInfo.getJSONObject("imageLinks");

                                    if(ImageLinks.has("smallThumbnail"))
                                    {
                                        item.setSmallThumb(ImageLinks.getString("smallThumbnail"));
                                    }
                                    if(ImageLinks.has("thumbnail"))
                                    {
                                        item.setThumb(ImageLinks.getString("thumbnail"));
                                    }
//                                  else
//                                  {
//                                      //item.setSmallThumb("No Thumbnail");
//                                  }
//                                  
                                    if(ImageLinks.has("previewLink"))
                                    {
                                        item.setPreviewLink((ImageLinks.getString("previewLink")));
                                    }
//                                  else
//                                  {
//                                      item.setPreviewLink("No Thumbnail");
//                                  }



                                }
//                              else
//                              {
//                                  //item.setSmallThumb("No Thumbnail");
//                                  item.setPreviewLink("No Preview");
//                              }
                        }


                        books.add(item);//add one volume to array_list
              }
         }
         else
         {
             Toast.makeText(m_context, "0 Record Found..",Toast.LENGTH_SHORT).show();
         }











         }
         catch(Exception e)
         {
             e.printStackTrace();
         }

     }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:37:07+00:00Added an answer on May 22, 2026 at 3:37 pm

    Here with a possible solution.

    As you are using the Book Search API and you are able to get the ISBN of the book

    Then, to allow your user to read the book , maybe:

    Using a WebView with the Google Docs Embedded Viewer API + your ISBN you will be able to load the book preview inside that WebView

    for example, a WebView with this code:

    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Google Books Embedded Viewer API Example</title>
        <script type="text/javascript" src="https://www.google.com/jsapi"></script>
        <script type="text/javascript">
          google.load("books", "0");
    
          function initialize() {
            var viewer = new google.books.DefaultViewer(document.getElementById('viewerCanvas'));
            viewer.load('**ISBN:0738531367**');
          }
    
          google.setOnLoadCallback(initialize);
        </script>
      </head>
      <body>
        <div id="viewerCanvas" style="width: 600px; height: 500px"></div>
      </body>
    </html>
    

    This is my solution for you, the trick is located at : google.books.DefaultViewer(document.getElementById(‘viewerCanvas’));
    viewer.load(‘ISBN:0738531367‘);

    I hope this helps you

    for a better understanding on this please visit http://code.google.com/apis/books/docs/viewer/developers_guide.html at The “Hello, World” of the Embedded Viewer API

    When you use that API you can get something like this: http://code.google.com/apis/books/docs/viewer/examples/book-simple.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a android application which I want to test on multiple devices
I am developing a web application which has Chart Controls. I have developed a
I have developed application for drawing some shapes (lines mostly) , now i need
We currently have developed an application using WCF. Our clients make connections to different
I have developed a haskell application which is tested with WinHugs interpreter working fine
I have developed an application in which i have implemented ontouchlistener with which i
I have an Excel addin application which I developed with C# and I published
I have developed about 300 Applications which I would like to provide with multi-language
I have to develop an application which parses a log file and sends specific
I imagine there are many of you out there who have developed an application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.