• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Android app question

Hello,
I am currently working on a project where the app will need to be able to pull stuff off of a specific website.

Does anybody know of a good website that can be used to teach how to do that and has some demo pages for accessing stuff?
 
Any simple website could be used for that. Just read the markup into a buffer using whatever web request class Java supports, then load the markup into a DOM (again, not a java programmer, so whatever they call it) and use xpath or collection traversal to walk the objects in the DOM until you find the element(s) you need... then extract the text value of the element.
 
Any simple website could be used for that. Just read the markup into a buffer using whatever web request class Java supports, then load the markup into a DOM (again, not a java programmer, so whatever they call it) and use xpath or collection traversal to walk the objects in the DOM until you find the element(s) you need... then extract the text value of the element.

And then you have to hope the structure of the website doesn't change because it will break your app.
 
Do you have control of the website or is this a third party website? If it's yours, set up web services on the server so you can save the hassle of extracting the info you need, and you can just use function calls to get the data.
 
Do you have control of the website or is this a third party website? If it's yours, set up web services on the server so you can save the hassle of extracting the info you need, and you can just use function calls to get the data.

I do not have direct control of the website. But the people I am doing this for do have control of it.
 
I do not have direct control of the website. But the people I am doing this for do have control of it.

Can you get them to add a little structured XML file or JSON containing the data that you need? It should be fairly trivial for them to do.
 
Last edited:
And then you have to hope the structure of the website doesn't change because it will break your app.

Naturally. If there are options other than scraping the page, like setting up a service entrypoint, then that is preferable.
 
Back
Top