i have three different kind of files ,
Document file
text file
pdf file .
while clicking button i need to render those file in webview of android, is it possible or not.
If any one know the solution means help me out.
Note: i need load those files from asset folder.
Thanks.
is it possible or not.
You can display a text file in a WebView via the text/plain MIME type. WebView cannot render PDF. I have no idea what you think a "document file" is.
Related
Is it possible to load .ai files and open them programmatically?
I wanted to convert .ai files to pdf files and want to show it.I know how to do it in iOS but don't know how to acheive it in android.
any tutorial link or suggestion would be appreciable.
To open a .Ai file it needs to have PDF Embedded in it, That`s an option you get when saving a .Ai file through Adobe Illustrator (include PDF Compatibility).
If the .Ai file has that, then all what you need to do is rename it to .PDF instead of .Ai, then open it using a PDF Viewer like: http://www.mupdf.com/
I want to save a .rtf Rich text file with my app as offline help. when the user clicks for offline help, the app will show this text file. I don't want to use pdf help file because it wont be accessible on phone with no pdf viewer.
I would like to use html offline page stored in Assets folder if that is a better approach than the RTF file.
I have seen this Loading existing .html file with android WebView just looking for the .rtf file answer now
I have an PDF file and there are certain inputs that ought to be filled in the same. There are two approaches to this. Either, I create an entirely new screen that looks like the PDF file and get the user inputs and parse it to the iText library to create a PDF file or open the template PDF and fill in the contents through the android screen and save it in different file.
I am trying to concentrate on the second option. Here, I will have to open the existing template PDF and enable the user to enter the input items. I will also have to allow the users to scribble in certain areas. Is this feasible? I have done some research and am not sure, if all these are possible using iText.
Please can someone help me?
I want to show a pdf (preferably) or a word document in my app; like a privacy notice screen. Many applications have it, so it should be possible. i tried loading a simple text file as a start but doesn't provide formatting, fonts or trade mark symbols. I've gone through a few posts but I couldn't apply it to my app. Could anyone tell me how is it done? Could I store the file somewhere in res folder and provide a path to open it through my code? I looked into the following link but I'm not sure if that's the right approach in my case android: open a pdf from my app using the built in pdf viewer.
Android does not support opening PDF and DOC files natively. You'd have to make your own implementation.
Like t0mm13b said, you should consider using HTML (+ CSS) instead and use a WebView.
I have a option to attach files within a application. I this I need to show users a preview or a icon for specific item type. Icons with extension .txt, .doc, .pdf, .jpeg, .mp4 need to have its own specific icons or if possible a good preview thumbnail icon. And when the user wants to view it he would be clicking on the icon or preview. I need to start a intent to view the file.
I mean a pdf should open up in a pdf reader, or a txt or doc should open in text reader, a mp3 or mp4 should open up in a audio or video player.. and the important part I want them to com back to my application when they do a back out of the view application.
The only idea in my mind is to search through the file name and manually split out the extension and do a string compare to check it against the constant string values like ".mp3" or ".mp4" etc. This is not a good idea as there are lot of extensions for image, audio and video type. Please let me know if there is any straight forward way to do this. Thank you for your help.
You could also read the mime type of the file and do it that way. Might be more accurate than just reading the extension although both would probably work.
http://developer.android.com/reference/android/webkit/MimeTypeMap.html
guessContentTypeFromStream(InputStream)
You can then have an array list of drawables that refer to each icon.