xml parsing with no browser use - android

I have read the example for Rss Parsing from the ibm site.(http://www.ibm.com/developerworks/opensource/library/x-android/).
In this example,the rss are shown in a listview and then,if you press one announcement you can see it in the web browser of the device.How could i see them in the app,with no use of the device browser?
Thanks a lot

Create a layout with a WebView then load the URL from each "announcement" using WebView.loadUrl.

I'm a little confused but you seem to have answered your own question.
You say you don't want to use the web browser on the device but the example in your question doesn't use the browser. It does exactly what you're asking for.
The idea is that you download the html from the website and then use the parser to break it up into separate "announcements" and store them in list view items in your program.
I have done a bit of this type of thing myself in android. I used jsoup java library, which makes breaking the html into the bits you want to display really easy.
If you want some more help I can give you an example of an app I made that pulls movie times from google.com/movies as an example. here are links to the classes where I did the html download and parse:
ScreenScraper.java
HtmlParser.java

Related

Rendering (display) a part of a web page in an android application

This question is not for android programmers only , but also for whom interested in web pages design .
I would like to make an android app that renders some parts of specific web pages only (not all part of them) .
I am heard about jsoun library as a tool that does this task
My main problem is:-
How I can choose the correct link from web page's source that render some part of a web page ?.
For example let us take the famous website FORBES
How can I render the list of richest men by their name and Rank,Name net Worth,Change,Age,Source,Country of Citizenship as they appearthere excluding other parts of web page.
Here is a good example of an application that accomplishes like this task
You may have a good suggestion.
You need to screen-scrape the HTML. I'm not sure about any Android libraries for doing this, but I would build a RESTful service to return the data I needed. The service would than do the heavy lifting of scraping the webpage and converting the data to JSON to be sent back to device.
On the server side I would use a library like Beautiful Soup to do the scraping. It is easy enough to use once have it installed. You create a beautifulSoup object from the HTML and make calls like myObject.getTitle() to return the title of the HTML. You can use the tags in the HTML to drill down to the elements you want and build up a JSON object from there. Here is an image of the elements you are interested in for that list. Note the #ids on the right for that list item.
http://i.imgur.com/TMjhYvY.jpg

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

GrabURL from Website table

Hi Guys I Want to Grab an URL from a site the page only has one or many URL link on it, I would like to connect to the site URL and grab the link fro inside the page And put that in a string, Can It be done? I want to do it in android. Excuse me If this is a simple question Is that I really don't know how to do it, I have done researched but I am confused.
I want to grab this page
http://nightlies.videolan.org/build/win64/last/
It's Vlc, There are 6 Links and they are constantly updated, How can I get the urls and put them each on a string on My activity?, I want to fetch the links when the app is loaded so It gets the links as they are changing from day to day.
Thanks
You need an HTML Parser like JSoup: http://jsoup.org/.

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?

Read HTML file from Website and convert into App

I am looking into developing an App that will convert a website into more readable data for an android app. I am at university and have an online notice board which can be viewed on the web but if possible I would like to transfer this into an app on android to make it more easy to read on mobile devices.
What I thinking is that the app would go to the website where the notice board is held and read in the html code to display each notice in a list adapter view. Each notice is within its own div so I assume I could use that to split each notice up into its own button on the list adapter view. Is this possible and if so how I can go about doing this. I have tried google for an answer but I have not yet found a solution to this problem.
Thanks for your help
It seems overly complicated to me. I wouldn't handle all that using Android. I'd crawl the data on a machine (server) and then I'd convert all needed data to JSON and have the Android (client) fetch the data using a simple JSON parser.
In my opinion that would be the easiest solution if you don't have access to the server the website is hosted on to get it generate a JSON feed for you directly.
EDIT: In answer to your comment Boardy.
Here is the official website of the JSON project in order to get an understanding of what it is. Then if you have access to the webserver providing that page (I assume it is a PHP based site) and want to modify or add the functionality of providing a JSON feed then you should also take a look at the PHP JSON documentation.
To parse JSON on Android check out this SO question and also don't forget to take a look at the official Android documentation on their JSON implementation.

Categories

Resources