Google Books API with Picasso - java

Problem with getting the thumbnails
Recently I was working on a project where I was supposed to getting the Book thumbnail from Google Books API
The JSON was as the following :
"imageLinks": {"smallThumbnail": "http://books.google.com/books/content?id=2wqEtgAACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api"
,"thumbnail": "http://books.google.com/books/content?id=2wqEtgAACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api"},
I tried Picasso Lib.
The Problem is when I was getting the thumbnail with these links the ImageView wasn't updated
Solution
It's very simple, Just replace http with https
**Notice that in both cases the image is already loaded.

Related

show pdf file in android studio using java, from a google drive link?

i m trying to show a pdf file from my google drive link sush as
https://drive.google.com/file/d/1H7GwpxteH-w3rSaQzd91sc15xNW5lFbG/view?usp=sharing
in android studio using the android-pdf-viewer. but this dependency works only with an uri with .pdf in the end. any way to solve this problem??;(
when i was using the android-pdf-viewer package i faced 2 problems: cant display a pdf from an url and the huge size of the generated apk.
i searched a lot for a good alternative but nothing found.
thats why i dispayed my pdfs in a webview. so it was fine.
One last problem was the long time to upload and display a google drive link in the webview. ;(

Download image with glide from network then show clustering map google utils

If I use local resource then everything is ok. But if I try to load image from network, somehow it does not work
My problem is exactly the same as this problem:
Android : how to reload custom markers once the image is downloaded via Picasso?
As you can see, Kali Aney tried to load image into mImageView (onBeforeClusterItemRendered)
However Stas Parshin's answer had nothing to do with mImageView. I have tried and it does not work

How to permanently cache data (Images) loaded?

My app loads and display thumbnails of top movies from a server via API. I don't want to query server and reload it every-time, I use glide to display images from server url.
How do i implement this image caching so that app uses previously loaded data, even if its offline.
Is there any library or do i have to store the images using sqlite and retrieve it ?
Thank you
If you use Glide to load the images, there is an extremely simple one-liner to cache all images.
Simple add '.diskCacheStrategy(DiskCacheStrategy.SOURCE)' to your Glide loading, and it'll cache the image, and use it even if you're offline.
So it could look like this:
Glide.with(context)
.load(imageUrl)
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(target);
You should take a look at the introduction to Glide, on their official github repo. It mentions a lot of details about how it works.

Downloading most recent Image from server in image view in android app

I am a newbie and as soon as I started learning the language I got one project. Most of it is done but I am strugglig in a basic programming problem. My app is supposed to provide the images of the price lists set by the commissioner in our city by downloadin from thir original website. The problem is after every few days a new image appears as new prices are set and the image's url in my app becomes obsolete. the new image that appears on the website does not have a ur that follow a pattern like image1,2,3 but it is a random number every time. Can someone please help me how can I solve this problem of mine?
PS. I know how to get an image in the imageView. All I want is to make the app smart enough to download the most recently added image every time. Please please respond. Thanks
You could search the image URL from the website using an html parser like Jsoup and then load the image into an imageview using the Picasso or Glide library

Android - Get Images from url as JSON and display them in Gallery view

I need to get some images located on a url using JSON and then show them in Gallery view. Are there any examples or at least could someone describe me the exact steps?
thx
Make a web request
Grab the JSON response and parse it
Load the Images using their URL
Use this library to load images into your Gallery View: Android Universal Image Loader
Here is one example that can give you complete demo as you need.
Read this and Learn it.
Steps are the same given to you by Mr. Paresh Mayani.

Categories