How to create our own PDF viewer for Android? - android

I want to build a PDF reader/viewer that could be used in my Android application, but I can't use Google docs to read my content. I can't use any PDF reader already installed in my device. It should be within my app and do not expose my secure content over the Internet.
What could I possibly use? Do I have to use the Android native dev kit to create my own viewer?

I'd recommend considering MuPDF which has already been ported for use on Android several times without reliance on Java. MuPDF is optimized for lightweight on-screen PDF rendering, making it perfect for mobile use.
Please note that MuPDF and all the derived projects are not suitable for the commercial use and you should consider alternatives if you are not developing an open source GPL project.

You will need pdf parsing libraries in JAVA... Parse the document, and display content in android. Below are some useful links :
http://java-source.net/open-source/pdf-libraries
http://itextpdf.com/
http://itextpdf.com/examples/iia.php?id=275
Advanced PDF parser for Java

There is an api in java, not sure if it is supported in android, but if possible.
You can use iText Api to read and write pdf documents in your application, and it does not require a pdf viewer is installed on the device.

There are opensource code available code.google.com/p/apv , andpdf.sourceforge.net/
You have to integrate this in your app there is no other direct way for do that.

I think you can use iText library to read the PDF in android.
Here are the few links for that
How to read a pdf using itext library in android
Not able to run simple program of iText library in android

Related

Can we use an android library (aar) in a GeneXus android app?

We have an android library for mobile data gathering (location, mobile device, etc.) that I would like to share with a partner. This aar component was developed using java and android studio, vanilla stuff.
Problem is, this partner is using GeneXus platform. I have performed a research and what I have found is that you can create an android component using GeneXus, but nothing related to consuming one (an external aar file).
Does anyone know if that is possible?
I also have verified that you can have access to "some" device data, like geo localisation, but that is it. Point is, I could create something in GeneXus, however with far less data richness than native android.
Yes, you can extend Genexus Android native app by using any native library you need to use.
Genexus provide Extensions Library for extensibility in native application.
You can create an External Object in Genexus and then use it in your application.
You can find a full sample in Github with step by step documentation:
https://github.com/genexuslabs/SDExtensionsSample
Best,

Xamarin: Can we use Ghostscript to display PDF on android

I have a problem rendering PDF on Android pre-SDK 21. I know SDK 21, android have PDFRender to render PDF but for pre-SDK 21 I have no way to generate the PDF apart from either using third party application or using google doc.
There is a ghostscript i have used before on MVC project. It generate the images from the PDF. Does it still work on Xamarin as well.
There are multiple solutions available that work on Android before api level 21.
You can use Xamarin.PDFView which uses pdf.js to show the pdf file.
Another option is Xamarin.PdfView.Android library which is a wrapper for java pdf view library.
One more option is MuPDF-for-Xamarin-Android which is a wrapper for java MuPDF library.

Need to access Dropbox files within Phonegap app supporting Windows 8 and Android

I am having difficulty in finding a solution for this issue.
I have an existing web application using JS, HTML and CSS with which I have used Phonegap to support both Android and Windows 8.
What I need now is a back-end to access Dropbox files - but I am confused in what I need to get going as it seems supporting both Android and Windows simultaneously is difficult / impossible.
I have also looked at using OneDrive to access files, but I have run into the same problem.
Is it possible to use the Dropbox / OneDrive API to access files in a Phonegap app supporting multiple platforms? If so, what do I need to get started?
Any help will be appreciated!
You can use the Dropbox JS SDK for this. I recently wrote a blog post about it on the Dropbox developer blog: https://www.dropbox.com/developers/blog/95/using-dropbox-datastores-in-a-cordova-app.
That post is specifically about using the Datastore API, but the same library supports files too.

Previewing and Opening PDF Documents in Android SDK like IOS SDK

For PDF files ios platform has UIDocumentInteractionController controller and UIDocumentInteractionControllerDelegate to open PDF documents in another application like evernote, dropbox, google drive etc. Is there a way like this for android platform? I found a sample for IOS in here but could not find a sample for Android.
Thanks.
I strongly recomend you look at MuPDF. This is open source project so you are free to integrate mupdf with your project, as well modify and distribute it. Developer say that muPdf is small, fast, and yet complete. And it's completly true!
But integrate MuPDF with existing android project is not easy. Here a few useful links:
Official docs
also look here
how to use with existing android project
Hope it help you
Not used this but you can try it ..
https://github.com/JoanZapata/android-pdfview

How to embed an Http server (like i-Jetty, Paw, etc) in android application

How can I integrate an HTTP server (like iJetty, Paw, etc) in my Android application? I can't find any useful tutorial on the Internet. Most of the websites (including the official ones) just provide the server specification and downloadable server jar files. I was looking for some Java code to integrate that file in my Eclipse project so that it could be used as server component in my application. Any help please?
Here's one I have successfully used:
NanoHttpd
https://github.com/NanoHttpd/nanohttpd
http://en.wikipedia.org/wiki/NanoHTTPD
NanoHttpd is an open-source, small-footprint web server that is suitable for embedding in applications, written in the Java programming language. The source code consists of a single .java file.
And here is an Android sample project that uses it:
https://gist.github.com/komamitsu/1893396
It's very small and simple and in pure java but it is fairly modifiable. There are others but they are a bit more heavyweight. Depends what you want to do. I would recommend you start small and see if that suits your purposes.

Categories

Resources