Source from HTML - android

I want to get the source code from various url so that i can parse them, is there any way to do this?
I tried some solutions but they where to slow, i need to get the source from 20 website the fastest way possible.
Thank you for the time

I've used HtmlCleaner in android successfully. Also take a look at this SO question

Related

How to read, display, open pdf file in android

I am a beginner of android. I don't know much about working with PDF and files. Please provide me resources that can be understand easily. Is there any third party plugins should be used? I have tried searching old questions but i am unable to know where to start.
You have a very good library (AndroidPdfViewer) for API 11+ that can open, zoom and have animations.
It's simple to use just read the .readme file.
It's based on PdfiumAndroid for decoding the pdf.
You should have a url to access that document . You can use HttpURLConnection class and read subsequent bytes through it . Here is a nice example android download a file

How can I parse webpage content in Android

I have a webpage that I know the contents of (standard look)
I am trying to parse the webpage in my android device so that I can extract certain information (say phone number). I have the URL.
How can I achieve this in Android? Any suggestion to how I can start or a quick example of doing so?
Thank you so much for the help
Try HTMLCleaner or TagSoup, for more information please check this example: http://blog.andrewpearson.org/2010/07/android-html-parsing.html
Also check out this StackOverflow question: What is the fastest way to scrape HTML webpage in Android?

Getting raw data from a Blogger "page"

Is there an easy way to extract the raw data from a Blogger "page". For example, please see the following page:
http://ftaca.blogspot.com/p/get-support.html
I'd like to scrape everything from "Get Support" through "p 82 ACA text" (essentially, the meat of the page without the surrounding navs and such) for use in an Android app that is related to this website. Are there any querystrings that I can append to the URL to just get the raw info (i.e. something like http://ftaca.blogspot.com/p/get-support.html?raw=1)? I've tried a few things, but none work. Mind that this is a Blogger "page", and not a post per se.
Thanks,
Chris
I believe that this is what I need:
http://ftaca.blogspot.com/feeds/pages/default?alt=rss
Thanks everyone for your assistance!
You'll have to ask the web site developers whether they support query strings for page subsetting. That isn't really Android specific.
If they don't, you'll probably have to write a HttpClient client (search here and you'll find lots of good examples) to get the raw HTML for the page, and then subset it within your Android app.

Is there a way to extract time spent on parsing, rendering, etc. during WebView load?

I know how to get the total loading time of a web page by using onPageStarted() and onPageFinished() in WebViewClient.
What I want to know is whether there is a way to extract detailed information on web page load such as time spent on parsing, rendering, etc.
Thank you in advance!
Use method profiling in eclipse to get memory as well as time taken in each step of your application.
Have a look here.
http://www.jpct.net/wiki/index.php/Profiling_Android_Applications
have a lok on its output format Time/Call cell provides information regarding time ellapsed on particular action
Thanks
Deepak
Have you tried WebView#debugDump()? It is marked as "deprecated", but it might still prove useful. Also try Profiling with Traceview, using the Debug.startMethodTracing() and Debug.stopMethodTracing() methods around your WebView start/finish locations. Then follow the instructions above to download the trace file and load it into traceview, to see where time is spent.

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