How to create PDF file with only one long page? - android

I have a very big HTML file. For now, i'm using HTML2PDF converter to make PDF from HTML, which works just fine for me, but it splited my html to a few pages. But what i want to achieve is the whole HTML content on one (long) single page. How can i do this (without $ libs) ?
Maybe i can foreach every single page in my pdf document and "merge" it in a one big page ?
Thanks in advance !

Related

Android parsing XML data example, webView or listView?

I'm following this tutorial and I modified the example code to let it work for my XML file, now it renders HTML into a webView and the result is a raw list of items (not very beautiful). I don't understand why it chose a webView to display data. Now I don't know how to go forward, should I follow the original approach adding CSS styles and HTML or should I get data and display them with a native listView? my problem is that the whole example is build on the HTML string composition and it seems quite difficult to modify to get only data and put in a listview.

Android. How to get String from html by longclicking on it

Help somebody, I am stuck.
The goal is to view html text with pictures and etc. and to be able catch longClick events on pieces of plain text. And then get this txt and do something with it.
If you are writing a custom application to load html documents then you should have the look at WebView documentation for it. It contains everything to guide you.

What should I use for getting data out of HTML

I hope you can point me in a right direction,
Im making a Android app that gets content of a website,
At the moment my app loads dat webpage in a webview, but the page is to wide for almost every screen, so i had another idea:
webcontent(html) -> get contents of table with android -> make a listview -> when sliding right you get another day.
the webcontent is a timetable for school, a example is this one http://intranet.staring.nl/toepassingen/rooster/lochem/2W2/2012102920121104/2W01532.htm
what i want is that every day comes in a listview and that a user can swap right or left to change the day there seeing.
Now im getting already stuck on making the listview from the html source, can somebody help me with this?
You should access those data using a webservice...
Because otherwise you'll need to download a LOT of useless HTML code + parse it...
But IF this is the way you want to go, or you have no control over that website, you could read the file and simply parse it using regular expressions I guess.
Here are some tools I found:
JTidy
JSoup
Parsing HTML in Java?

Display HTML document in Activity

I am parsing an RSS feed using SAX to display a list of the title of the latest posts.
When I click the title, it opens the browser, showing that URL.
However I want to display the article, including the HTML styling and images in a new activity.
I can get the article part by parsing the variable 'encoded'
Link.
It is pure HTML. It also contains <img src='...'> tags.
What would be the best way to display this in an activity?
TextView can display HTML, but I don't think it displays images.
Webview can show local HTML, but in this case, it will be dynamic.
Is there any way to display an HTML document in an Activity, including styling and images?
I think you need a webview. There's more info here too.

Take an element from a website and put into an android app

Okay noob of the year question.
I have a website, which has several div. and one of those div I would like to put as the front end of an android app.
I.E, I have this div id
I want to put that entire element as the android application. Of course add buttons for it for various items, but right now that is my main obsticle.
I dont want to hard code the page into the android application, becuase of course that element changes.
Thank you in advance.
You could use a WebView to display a Website inside your application. See this article. If you want to display only one div of a website, you could move this div to another page. This should be the easiest method to achieve your goal.
BTW: There are no stupid questions ;-)
One option would be to code your site so that this DIV has a unique ID assigned to it. You could then download all of the HTML from your site into a string in your app, parse out this individual div you want (by finding the unique ID) and save it in a string named, say, html. Next you can place this DIV inside of a webview using webView.loadData(html, mimeType, encoding); where "html" is a string containing the div you extracted. So long as that DIV has content that has absolute paths to resources (images/links), it should load and display your content properly

Categories

Resources