I am developing an Android application which only works with text documents. Currently I'm using PDF format. But the total size of all the documents leads to some 25-30mb, too much for an app.
The app is required to open the text documents and also allow features like zoom, search, etc. For this we considered a PDF viewing library, but that is simply increasing the size of the app.
We have considered redirecting the PDF's to open in default apps in the phones. But there are some text documents that NEED to be viewed through our own app. But a PDF viewing library isnt the best solution due to already huge size.
my question is : is there any alternative format to PDF format to be used in Android application that allows file compressibility without loss of quality?
and does not require a third party library to open the text documents.
Also , will I be able to zoom in on the text?
is there any alternative format to PDF format to be used in Android application that allows file compressibility without loss of quality?
HTML.
does not require a third party library to open the text documents
The WebView widget in Android can render HTML.
will I be able to zoom in on the text?
You as a developer can control the zoom level of the WebView, and users may also be able to use pinch-to-zoom gestures, depending on your content and the WebView size.
Related
okay, so i am making an app (i am new to android) which will have notes of a particular subject. I'll be creating these notes in PDF format.
Now i have implemented points system in my app,
So with 100 points you can unlock the notes and read it in app and with 1000 points you can save it on your device (locally).
So now PDF viewers and all are complicated, so I'll be converting these notes from PDF to HTML and I'll put all the resources and HTML in assets folder. I will display these html notes in a WebView. So now my question is should i use an external library for WebView ?
What i basically want is :
- User should be able to zoom in and out (as he is comfortable reading the notes)
- Scrolling should work in webview(which usually does natively)
- User should not be able to select text in the webview (read only mode type) so that he can just not share the content.. if he wants to share, use 1000 points and download the PDF...
how do i implement this ? downloading the PDF is a later part, right now i am more concerned about
User should not be able to select text in the webview
Is this possible ? Screenshots are okay. (i know its not but notes will be huge so screenshot will be a task too :P)
I think you can do one thing which is you may use this following approach if it suits all of your requirements:
1] You can get the PDF downloaded in the end user's phone via hitting some URL (you will need an API for this) or you may place it in the app's storage:
i) Assets folder - If you want to keep/store some PDF already in the app (this may increase your APK size as well as you cannot write something to the assets folder but you can read from it) or,
ii) Use SQLite database - You can manage your own SQLite database for Android for storing PDFs (this is an effective approach as you can read as well as write data to this database, if implementing this), both of these storage options are fully secure unless the device is rooted i.e. data cannot be accessed from outside the app unless the device is rooted and when the user uses/grants his 1000 points wanting to save a file (PDF) on his device (locally), you can then write that file to the external storage of the respective user's device from your app's database thereby making it accessible outside of your app.
2] You may use the PdfRenderer class (present in Android), which enables rendering a PDF document (which was added in API level 21 i.e. Lollipop). If you use this, then only users having Lollipop and above in their Android devices can be converted as your app's end users. So, keep this thing in mind. What PdfRenderer does is, it renders every page of the given PDF into a bitmap image which can then be displayed in an ImageView, this can fulfill your requirement of the content must not be copied from the given PDF's pages as each page of the PDF is a bitmap image now that's displayed in an ImageView.
References:
a] PdfRenderer theory - https://developer.android.com/reference/android/graphics/pdf/PdfRenderer
b] PdfRenderer sample (using Java code) - https://github.com/googlesamples/android-PdfRendererBasic/#readme
c] PdfRenderer sample (using Kotlin code) - https://github.com/googlesamples/android-PdfRendererBasic/tree/master/kotlinApp/#readme
3] Then, you can apply ScrollView as the parent if your rendered bitmap image (single bitmap image for a single page) is large enough than the respective device's dimension.
4] For the zoom in and zoom out effects to be applied on that bitmap image you can use the Chrisbane's PhotoView instead of using the normal ImageView.
Reference:
a] Chrisbane's PhotoView - https://github.com/chrisbanes/PhotoView
Note: Orientation handling of the app should also be done as to give a better UX to the respective users of the to be made app. Wishing you good luck!
I have an app for android and iOS. I want to add in app option, which allow user select book from list and read it.
List of available books will be load from server.
Now i wondering which book format to choose. First i'm thinking about pdf, but it has not-flexible reflowing for different screens(books contains sheets and formules). Maybe .epub would be good choice?
ps. is this possible to prevent user copy loaded book files?
Should i load files only in memory(without saving on sd), but how then work with files exceeded ram memory?
have you know any good iOS and android libraries, sdk for reading ebook files?
I am searching for the same SDK options and found this for ePub:
http://skyepub.net/downloads/
There are handfuls of PDF SDKs. Throw a dart at the internet and see what it hits, however, I would like to know which ones have risen to the top (e.g., the top 3).
Still looking for .mobi (Kindle's format).
For the first time I am building a book app. I am developing the app so that you can pick from one - 5 books and buy the book as an in app purchase. I am using phonegap to build the app.
My question is what file format do I need to use for the actual books for iPhone? and what file format do I need for Android?
I need to prepare the file of the actual book and I need to know what extension they should be in to properly function. thanks!
You can use any one out of .epub, .mobi or .pdf.
In .pdf files Adobe has addressed the drawback of fixed screen size by adding a re-flow facility to its Acrobat Reader software. Most good PDF software now supports reflow so this limitation is one best left in the past.
Here are few links on same
PDF
Comparison_of_e-book_formats
Hope this help you.
I think you should look into the open standards like epub or mobi. PDF I wouldn't recommend, because it's very static and doesn't scale well. (e.g. a page is a page, regardless of the screen size)
I have to make an application that should capable of reading PDF documents on Android device. Actually I do not want my app to be dependent on other apps to read the PDF file.
I had gone through the questions that are asked here and at some other places also. They all directly or indirectly using third party app.
Is there any API or something similar is available through which I can implement reading of PDF files directly in my app? How about converting the PDF document to PNG image? But the PDF-PNG method wont let users select the texts.
Any suggestions?
Thanks
There exists an library from Adobe that you can use. Its based on the NDK and you need to do the wrapping all by yourself. Its also extremely expensive, basically nothing for a small firm/single developer but for bigger companies. Afaik the license is not only expensive but also annual based, so you need to pay for it in every year...
There are other libraries, basically open source. Some of them have good performance but a lack of functionality (most of them based on NDK, too). I found only one pure "java" library but the performance was more than worse (loading time 10sec for a page and more).
There are three possibilities you should consider:
Using an external application, so you just need to implement the library of your PDF documents
You write everything by yourself including a pdf reader part
You create a middle "tier" where you convert your PDF into PNGs or JPG (I prefer PNG for better quality). The much better performance comes with a lack of features.
I'm currently developing a complex application like mentioned in 3. but I can't go into details, sorry.
I would definitely recommend the Qoppa stuff on Android.
What is the best way to integrate a PDF document into my droid app?
I am attempting to recreate the same functionality we provide on our website in our mobile app.
I have 2 options of delivering the PDF to the device but the route I choose depends on the best way to implement this functionality on the device.
I could stream the document do the client and store a local temp file for viewing OR I could simply provide an HTTP URI for the document and present it on the device.
My main question is, what is the best way to integrate PDF viewing on the DROID? Can I check to see if they have Acrobat Viewer installed and make a call to the app, passing the URI data to it for loading?
I am attempting to recreate the same functionality we provide on our website in our mobile app.
Not always a good idea.
Just my thoughts here, is there a reason that it must be PDFs delivered to the device? PDF is a very poor format choice for mobile devices. There is no native compatibility for the format, they are most often laid out for print document sizes, and they do not support text reflowing. Viewing PDFs on a mobile device is more of a chore than a helpful function.
If you are looking to embed the PDF as a view in your application, then you can try this vudroid.
I have been using this by including this project as a library and some minor tweaks to the library.
They have provided a PDFView and a service which renders the view.
Works for me; a bit slow though.
Hope that helps.