How to get images url from html to java - android

Hello i'm tring to get the url's from Bing images. i.e this link return cat images
how can i get only the .png url's?

If bing supplies an API, then you should use that.
If it does not, then you get the .html file and parse it. Last time I did something like this, I used JSoup library.

Related

How to generate lh6.googleusercontent.com/[LONG_CODE], image url of a drive image, using it's doc id

So I'm trying to obtain a direct display url to images in a drive, using their document id's, like the url's that end in ".jpeg" and such, that only display the image, then use this link within my code to download the image.
I found a url that was supposed to do that:
https://drive.google.com/thumbnail?id=[file_Id]
but once this url is typed in and enter is clicked, it changes to a long url beginning with lh6.googleusercontent.com, this url is what displays the image the way I want when typed into a browser.
The problem now is, in my code, when I try to use https://drive.google.com/thumbnail?id=[file_Id] it doesn't work but when I use the long code beginning with lh6.googleusercontent.com, it downloads perfectly, so I want to know how to generate this lh6.googleusercontent.com url from the doc id, within my code, so I can use that as the download link.
The app I'm trying to make is Android, and I'm making it using Corona with lua.
Thanks

How to read spesific content from internet page with Android

is that possible in Android to go though whatever link and get main content from that page(f.e.text) or whatever i want to get? If yes, how i can realize that?
There is couple ways to get data from websites.
First and maybe the most popular way is parsing RSS feed from webiste. Java and Android are providing couple parsers and ways to parse xml or in this case RSS Feed. You can take a look in this examples:
https://developer.android.com/samples/BasicSyncAdapter/src/com.example.android.basicsyncadapter/net/FeedParser.html
https://www.tutorialspoint.com/android/android_rss_reader.htm
Second way is getting needed informations from API if it is provided from webiste and offten that API will be in JSON format. For example https://openweathermap.org/ will return JSON file filled with informations of weather which you can pares into your app. Also Android and Java are providing couple ways to get informations from JSON format. You can take a look on this one:
http://www.androidhive.info/2012/01/android-json-parsing-tutorial/
Third you can use support library called Jsoup for parsing HTML from particular webiste/s. You can find examples how to parse HTML on their offical webiste: https://jsoup.org/
Maybe there is more ways certanly you should look up for them.

Android App that pulls Information from URL (IMDB)

I want to add a tab to my Android App that pulls information from the web. The first tab should be a list of the most popular TV Shows on IMDB (http://www.imdb.com/search/title?at=0&count=100&sort=moviemeter&title_type=tv_series,mini_series) for example.
What would be my first steps? How can I parse this data and then reuse (the title for example) in my app? I am not really familiar with API and parsing data, so I need some guidance towards the right direction.
You can try Jsoup for parsing html data.
Include jsoup in your app by configuring the build path.
Jsoup is so easy to use and parse data
The jsoup website itself is very helpful for its usage.
For easy parsing of the website first understand the source of site and use the Online Jsoup Parser

Loading images from tablet local files with JSON

This is my first post here and I've got a big problem concerning the access of local file addresses on tablets.
I'd like to load image files in a game by using AJAX to get a JSON file containing URLs of images. My problem is that I dont know if it is possible to get local file addresses directly from the tablet folders using JSON.
Seems like I should use an URL that looks like this "storage/sdcard0/myImage.png." but I'm not sure that it's actually calling the file. Is it ?
I'm using Construct 2 because I'm not a coder, so I'm quite limited as for raw JavaScript programming. Please try not to flood me with code :D
I believe you can, URI can be used for urls and local filepaths:
URI | Android Developer

Display image using a RSS feed

I have an application in which use a RSS feed reader. My problem is that I don't know what is the best way to display an image. The closer I could get was to pull the image description (). I know I could parse this String by myself and get the image url, but I was wondering if there is a more elegant way to solve this issue. I tried using the SAX and the DOM classes, but I couldn't figure it out.
Best way to DISPLAY the image? I'm not sure if that's actually what you're asking, but just use an ImageView. Use an AsyncTask to download the image in the background, and then create a new Drawable from that downloaded image (might even want to cache it to storage) and set that as the source for the ImageView.
there is a library for downloading and caching images in background from the URL
https://github.com/koush/UrlImageViewHelperSample
=)
Are you asking how to get the image URL from the XML RSS feed? There's nothing built into the SDK that's going to help you parse the XML, other than SAX or DOM which you have already noted. There is a learning curve to those, but they are reasonable approaches.
There's a project called ROME that is an API for robustly parsing all sorts of feeds, including RSS. You could import this library into your android app. Note that this library has other dependencies, so you'd have to import them also. I haven't done it personally, but I have heard of people using ROME in Android apps, so it's doable.
Or more simply, if you just want the image URL and you don't need a complete feed parser, you can use java.util.regex to parse out the fields you want.
If you are asking how to display the image after you have the URL, kcoppock's answer explains it.

Categories

Resources