Reputation: 51
I know how to get data from a url but my point is when a user paste a url in my EditText I want to expand the url to get the description and main image from the url. When we paste a url in a facebook/google + EditText it will read and expand the url so I want just like that. In web development we can get those data from html < meta > tag but in android how can I just get the < meta > data rather than whole url html.
Upvotes: 1
Views: 151
Reputation: 2293
Check out this question on So: How to extract meta tags from website on android?
You can pull the meta tags from websites using that library.
Due to the lack of documentation on that other library, I did some research and found something better. There is something called jSoup which is a .jar file and can be imported into your libs folder in your Android Studio project.
jSoup let's you pull tags from websites using a method known as scraping. Disclaimer: make sure you have permission to scrape a website depending on what you're doing with the results. Here's a great tutorial on how to use jSoup to pull tags into Android. It has a really well laid out example.
Hopefully this works a little better.
Upvotes: 1