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.
Related
In my codenameone app (ios/android) i want the user to be able to print out what is rendered on the screen. This could be tabular information or maybe a certificate of their achievement.
But what options are open to me get that screen content onto A4 paper?
FYI to generate the formatted screen, the app will have received the JSON data from a Dropbox MySQL database, and then formatted as normal.
From reading this forum, I know that direct print is not a feature of apps, so my next route is to use the ShareButton object in CN1 and get the user to basically export the screen content to a 3rd party app, which can print. But this is limited to text strings or photos (not both) and so a tabular screen would not export correctly. I also expect that doing this from an iPhone to the Mail app would not be fit for A4 size.
The mobile browser does this very well by being able to export to the PDR reader but that PDR reader isn't an option when exporting from apps.
Thanks in advance.
Recent versions of Share allow sharing both text and an image as far as I know so this should work. Generally the most common approach I've seen is to generate a PDF on the server and then use Display.execute() to run the PDF file which launches the OS native viewer.
I know some folks did some work on print integration based on questions asked here and in the forum but I don't know if they succeeded. There is nothing contributed back as far as I know.
I'm developing a simple Android App where the user must fill in a very complex form, for which I believe it's much easier to use an HTML form than an Android Activity with tons of TextViews.
The data collected by the form must be sent to some remote database, and the application must be able to work offline.
I thought of two alternatives, the question is: which one would be better?
Let a WebView load a remote website with an offline manifest
Let a WebView load a local website in assets folder
My second question is related to the storage when offline, and once again I have two options, and I don't know which one is better:
Using the HTML5 local storage, and let HTML + javascript send data to the server when online again
Let my Android app catch the form data, and handle everything the Android way.
Any input will be very helpful. Thanks in advance.
Regarding the first question: depends on how often will you need to update your form. An online cached form can be updated quickly, while bundled pages are only updateable together with the app, and you will need to consider that both legacy and new clients can connect to your server at the same time (users will procrastinate updating).
Another aspect is portability. Do you envision an iOS version of your app, or perhaps a mobile site? If yes, then an HTML5 solution is definitely more portable. Also, debugging an app which is entirely HTML or entirely native is usually easier than a hybrid one -- you can stay within a single debugger.
Perhaps, one drawback of using HTML local storage inside WebView is that the data you save will be in a kind of a "black box" -- you will not be able to back it up easily.
[Added later] OK -- one drawback of putting your site into assets folder is that you'll have to use file: scheme in order to access it. This can lead to some cross-origin loading access related issues if you will try to mix your bundled content with content from the web. Check these WebView settings for example: setAllowFileAccessFromFileURLs, setAllowUniversalAccessFromFileURLs, setMixedContentMode.
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.
I am managing a bunch of PDF files in an android application maintaining a list of records in a SQLite database as well as storing the pdf files on the external storage.
Now I would like to present a thumbnail of the first page of the pdf in my list view as part of each cell representing a pdf.
I am aware of libraries like iText, fop.. on the JavaSE side that can render a PDF but I would rather not delve into embedding a large library like that. On a similar approach I would also rather not embed a native PDF viewer like droidreader, apv or vudroid.
Otherwise I could of course also get it rendered on a server via some webservice but that is a lot of headache as well.
I am already using intents to get the pdf's displayed for the user so I was thinking it would be great if I could get a thumbnail via a intent call as a result somehow. However I found nothing on the web (e.g. on openintents) that indicates something like that exists ..
So I am a bit at a loss on what to do? What do you think is the best approach to get these thumbnails into my app? Are there any public intents available? Or did I just totally miss something and the SDK provides features for that already (it should imho but currently does not)?
You are going to get a lot faster resopnse rasterizing the PDFs on the server and there are lots of libraries to do this in C, Java, Php.