I'm trying to get my app to open another app, a file manager, to select a file and return it's path to my app. For example if I were to go to my phone's web broswer and attempt to upload something to the web, it'd ask what app I want to use to select the file. Choosing the file manager I would then search for the file, select it and then send it back to the web browser for the upload. How would I do this in my app, I've looked at https://developer.android.com/training/basics/intents/sending.html but it hasn't helped me.
Related
I have been able to successfully create a TWA from the base instructions provided. It links to the website and works as expected.
However, one of the functionalities of the web app is to upload a particular file type (which is a type of zip) and display its content. That functionality too works as expected and one is able to upload the file, say from the downloads directory to the app and it displays.
What would be desirable is: for the user to tap on the file from the directory (say downloads) and it opens in the App. I am aware of the limitations of access a local file in any web app. But before I tackle that issue I would like to know if there is a way to associate that file extension (or mime-type) with the app. And more importantly how to at least get the path of the file. In the current setup there is no custom Activity java code written. I went by the documentation and put the right settings in the manifest.xml and the site gets loaded.
Thanks.
This is possible by implementing Web Share Target in your Progressive Web App, then enabling it in our Trusted Web Activity.
When using Bubblewrap it will to automatically configure the Trusted Web Activity on init.
I'd like to generate a signed link via S3 and then allow a mobile user to download this file. So far this is going okay (downloads with the correct name, filesize, etc).
However - when it comes to opening it (even a .png), I get the message "Cannot open file" and it doesn't turn up in the device's photos, gallery, or anything like that.
Are there some kind of headers missing? Some extra bit of set-up?
The context is a React Native app where the user requests a file, opens the URL via Linking in Chrome, Chrome downloads it, and then they can open it properly. Ideally this will work for any file types (e.g. png, jpg, docx, pdf). Thanks!
If you can't do this in ReactNative, you can always leverage on a native picker. https://developer.android.com/guide/topics/providers/document-provider in any case, there are tons of information to open files in ReactNative with some extensions as: https://github.com/huangzuizui/react-native-file-opener. I tried a couple of them and they work. It should do the job, check the permissions in your application as well. It can be a headers problem so you need to check all of this.
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.
We are working on an android app that generates PDFs based on app contents on users' request. We are providing an option to launch an email agent and attach the generate PDF, but we also want the user be able to view the document later at any time. On android, there are no stock file explorer, so our first thought was to show on the stock Downloads app's file list. We've tried the following two methods but without luck.
We firstly tried to save the PDF to the default download folder (given by calling Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)) and invoke media scanner, but the file doesn't show up in the Downloads app's list. It's shown in Adobe Acrobat's local document list though.
After some research, it seems that the Downloads app would only show files that downloaded though DownloadManager, so we tried to generate the PDF in a temporary directory and call DownloadManager to download it, but, somehow expected, it complains that we can only download via HTTP(S), so this approach isn't working as well.
Is there any other solution?
well if you have to provide access to the document without any file explorer app, i think your approach is correct it to allow to store it in the Download lists. To achive this you can use Nanohttpd in your application to host your pdf document and then invoke the DownloadManager download action using HTTP(S) to your webapp (you will have to create a small webapp to handle the download request) hosted on localhost server.
Is there a free way to view postscript files on android? I cannot find a solution online but surely lots of people must want to do this.
Recently Sam Buss and I realized that you can upload the PS file to Google Drive and once its uploaded to your drive, the drive viewer will open and render the PS file on your android device.
Here is a way that just worked for me on a Samsung Galaxy 5. Something similar can probably work for others. The general idea is to download the postscript file, and use an online web service to convert it to PDF, which you can then view.
Download the postscript file.
Open your browser (I use Chrome). Navigate to www.ps2pdf.com. Navigate your way to their "Convert" page, click the "Choose file" botton. Select "Documents" when it asks for "Choose an action". Go into your "Downloads" folder on your phone. Select the downloaded postscript file. Then, back on the ps2.pdf.com page, click the Convert button.
Click the active link for the converted PDF file. This opened in Adobe Reader, which is my default PDF viewer). If I want to access the file from other programs, it is in Adobe Reader's "Recent" folder in my phone's documents.