epub 3 + android + parser + how to - android

My next project is writting an Android application that would support reading EPUB version 3 files.
I wont be able to use any libraries (that would support this) since i need to write everything from scratch and i cant find any good "starting point" of how to read epub files, how to show them in webview and so on.
So are there any tutorials or how to parse through this epub 3 format and show them in webview
in android.
Any help would be appreciated.
Thank you

I suggest breaking down the problem into smaller pieces that you can research individually:
EPUB uses zip as its container, so you'll need a way to read zip files. If you can't use a library for this, then you could roll your own unzip code. (Example)
Parsing EPUB. If you can't use a third-party library, then you'll need to read the source code for an EPUB library, learn the algorithm(s), and then implement them yourself. The format is based on XHTML, CSS, etc., and should be straightforward to display in a WebView once you understand the layout of the files.
Display the output in a WebView. You can either point the WebView at a local file or pass the markup for a given page directly using WebView.loadData().

Related

How can I convert .vp file into .xml or .apk file?

I'm using justinMind and I get .vp file.I am able to convert it in .html file but how can I convert it in .xml or .apk?I have tried to convert .html to .xml by using .tidy but It doesn't give me proper layout in my androidstudio.
I don't know this SDK, but from I quick search, I found this post on there forum :
https://www.justinmind.com/community/topic/can-justmind-export-the-prototype-directly-to-the-android-studio-project
For long term save, here is the two post :
Question : I can use the software for simple designing and prototyping. It will reduce the app build time if there is a way to export the files as an android studio project. Is this possible?
Answer
Hi there,
Unfortunately that is not possible. However, you can utilize the
generated CSS and Javascript, which may help reduce app build time.
Best,
Danielle
So you need to use the generetad HTML/Javascript/Css files with a WebView. So no, you can't create a project, only the HTML files.

Reading Excel File without using jar file

I am new to Android. I want to know whether it is possible to read data from MS Excel file without using any jar files in android?
If it's possible then what's the best approach to do it .
Yes and no.
It's entirely possible to code a complete Excel API to read (and write) an Excel file. But that takes time and a lot of energy, as these formats are huge and complicated. You are practically mirroring the functions of Apache POI or JExcelApi. And these projects are huge.
As I don't know your reason for not using an external library (like an .jar) to read Excel, my answer is: Yes it's possible. Read the excel specification and implement an library to read this format. But practically: Don't do it and use the libraries from above. This will preserve you from a lot of pain.

creating an emailable or printable document using an Android app

Can anyone recommend a good source (either a tutorial or book?) on how to generate a .doc file from an Android App?
I am completely new to programming and don/t understand most of what I read as answers here, hence the need for a recommendation: I need to learn!
What I'm after is to be able to produce a document based on a standard template, containing a choice of standard paragraphs with user insertions, which can then be emailed, all from a smart phone or tablet.
Unfortunately I think you have a research task on your hands. If your requirements allow you to create an Open Office XML document then its possible to insert the user's paragraphs 'by hand'.
An Open Office XML document is just a zip archive with XML files inside of it. Unzip the template document using java.util.zip and locate the word/document.xml file inside. Insert the user's text using the DOM and persist the file.
Another approach would be to try to get docx4j integrated into your Android project. My guess is that this project reference many libraries that are not included with the Android SDK.
Good luck and hope this helps.

Targetting to multiple file format file (eg. pdf, doc, ppt)

In Iphone you can open pdf and other file format using WebView. so, why android is not having similar functionality, for online mode we can use
"http://docs.google.com/gview?embedded=true&url= "
but in offline mode(without the internet access) how u'r going to do.
-- so, any how you are going to manage for pdf. file also then how you are going to target for other file format. It's really a biggest issue... I am struck with these things and aspect better solution. Thank you.
There are no JAR's that I'm aware of at the moment, but there is a project here that allows you to view PDF's, maybe you wanna give that a try?!
In Android the only way is using Intent and set the setContentType for the particular file format which will redirect to the number of application support the file format.

Create PDF / Word (Doc) file within app

Is there a definitive method of creating either a PDF or a MS Word Doc file within the app and email it immediately (and possibly, also store it).
I have been trying for quite some time and have found out the JAVA libraries: apwlibrary and iText. But both of them dont provide any tutorials of sorts.
Could anyone point me in the right direction?
EDIT: Come to think of it, is could an online PDF generator be used, first by sending the data to the service, then retrieve the result and save it on the phone?
I would recommend apache fop http://xmlgraphics.apache.org/fop/
you can use standard FOP to generate pdf.
Unless it is a core feature of your device to create a pdf file I would suggest not to do it yourself. Adding PDF creation is going to be quite a lot of work potentially depending on your performance needs. Java libraries will be easier to add but less performant. Native libraries combined with Java will be more hazzle to maintain build and bug fixing wise.
If you just need to email some information why dont you create a message text in html and use a intent to email it with the build in email program instead? Or if you want you could e.g. put the PDF generation on a server and just email a link..
I'm working right now with JasperReports, an open source library to create reports in Java and export them to PDF, DOC, XLS... Using it in conjunction with iReport to create a group of templates makes it really easy to create files filled with content from different types of sources (I'm using JavaBeans).
If you don't like the idea of having static templates (That's a bit annoying depending on your needs), you can always take a look at DynamicJasper (The examples on the website are great).
Good Luck!
I have used Apache POI. It seemed to work well. http://poi.apache.org/
This actually, http://poi.apache.org/hwpf/

Categories

Resources