I am struggling with how to make a custom file extension open in my android application through the google drive ui. My file currently opens fine through dropbox or the android file explorer. Google drive seems to only consider the mime type of the file. The file extension is my own (lets say .xyz) and the file is xml on the inside. I want the file to open in my app not just any app registered to open text/xml mime types. How can i tell google drive the .xyz files are not to be treated like text/xml. Similarly i don't want my app to be registered to open all text/xml files.
So the end user workflow would be this: 1) Open Google Drive android app. 2) Tap "somefile.xyz" -> The file would be opened in my app. Currently it opens in the google drive xml viewer. 3) Tap "otherfile.xml" -> The file would not be opened in my app.
However, there may be times when you want to choose a different format, such as PDF. Double-click the desired file to open it. The file will appear in a new tab. Select File > Download as, then choose the desired file type.
By right-clicking the web link to the document and picking Open with Google Drive Viewer from the pane that opens, the extension will load the linked document in the appropriate Google office app. (You may need to reload the browser tab to get the document to appear, particularly if it's a . ppt file.)
Open File Manager and browse the the folder containing the files that you want to associate with a particular app. This will set the target file types to be opened with the selected app and open that file in that app as well. By the way doing things in Android is not too difficult.
Turns out the answer to this question is you can't do that.
With a file called .xyz and a format of xml on the inside the best you can do is to create various intent filters to handle all the ways other apps identify the file. For Example I put the following mimeTypes in my intent filters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With