How to set Dialog box from stop opening default app in android? - android

what the problem i am facing is in android mobile when you have only one app for viewing PDF document, in that case when you select a pdf file it opens directly the existing app for viewing without asking any permission but when you have more than one app for viewing PDF file and when you select a file it will ask your permission to open which app for viewing. Well, what i need is it should ask permission even when i have only one app for viewing pdf file.
Can it be done in android device?

If you wrote the PDF viewer app you could have it read the intent data for a file location on the phone to open the pdf file.
From the app that clicks the pdf file, you can start an intent and pass the file location with it after a pdf is clicked.

Related

Settings to show android app in open with list

I am developing an android app that has a feature to download a file when user clicks on a button. The file type can be any of Word, PDF, Excel, etc...
File download shows appropriate android app to open when the file type is Word, Excel or PDF, etc... I have a file type that is specific to customer and they developed an app to open and view this file. When the file type is this particular type download is not showing this customer app in open with list.
Customer app is already published to play store and I don't have control over it. So want to know if there is a way to fix this issue either by some setting or by adding some code in my app.

How to open a PDF file onclick of a button in Android?

I need to save PDF file when my app installs and then open it when a user clicks on a button. I found many solutions but was not able to integrate them into one.
Try this code, display pdf file from a file location (works from any file location, not SDcard specific)
How to open a PDF via Intent from SD card
I was doing this in work today and it is not that easy.
1) saving the file is not difficult any normal file code will work for a pdf file.
2) showing the pdf you have two options you can display a pdf in a webview if the device has internet access by displaying a Webview and loading google docs with you pdf file at the end of the url
3) or you can create an intent and see if the device has an application that will display the file, you will need to use a FileProvider to get it to run but there is a good post
https://developer.android.com/reference/android/support/v4/content/FileProvider.html

Opening an Android Application from a PDF possible?

I was wondering how to open an android APP from a PDF. I wanted to make a PDF document for kids that would automatically open the application when the child pressed on the apps button on the PDF document. I can generate links in the PDf that will make it open videos and go to web pages, but not that could open an application already installed on the tablet.

Is it possible to view pdf files within an app in android?

I'm working on an app that will need to open a pdf inside the app itself. Is this even an option or does the user have to view the pdf in a different app altogether?
This is open source for open pdf file in app, maybe you can try it
android-pdfviewer

Restrict a pdf file, opened in external pdf android app, to be shared/copied

I am working on app that has to open a pdf file in an external pdf application. It works fine, the file is opened in read-only mode. but this file can be shared via Facebook, gmail etc. I want to restrict it from sharing, as per privacy purpose.
Thanks in advance
You would need to create a whitelist to limit which intent is fired when you want to open the PDF in an external application. See this for an approach.
[EDIT] If someone stumbles upon this question later, once you fire an intent to open an external application, there is no way to control what that application does with your document.

Categories

Resources