Replies: 2 comments 4 replies
-
I'm not entirely clear on what it is you're trying to do. Your original code uses subprocess to start a completely separate process to open a file. That approach won't work on Android, because you can't use subprocesses. However, File intents aren't really what you want either. A File intent is the analog of Python's It sounds like what you want is the Action View Intent - that's the mechanism you'd use to open a URL in a web browser, AFAIK the same approach is used for any URL scheme or content type, and it's up to the device to determine how to satisfy that View request. However, that approach also won't work with a file in your app's resources, because that won't be a URI that is visible to another application (which is what you need to "open in acrobat" on Android). It also presumes that the user has an app installed that can handle PDF content (i.e., that they have acrobat, or an analog of it, installed). |
Beta Was this translation helpful? Give feedback.
-
I need to display a PDF file in an application. The method doesn't matter. The first code is just an example of how I solve it in Windows. If it is possible without another application, then it is better. I tried to use Android resources, but without success.
←[33mW/python.stderr: Error in async handler: No module named 'android'←[0m And it might be necessary to insert "parcelFileDescriptor" somewhere. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I wanted to transform this part of the code for opening a PDF file in Windows to Android::
I compiled this
Instead of opening the file I get the error "exposed beyond app through Intent.getData()". Do you know what to do about it?
They came up with something here. But I don't understand how to use it in Toga/Python
In the future, I want to open it from internal memory/memory card. But now I don't want to deal with access rights issues, so I put the file in resouces.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions