open file - part-cw/lambdanative GitHub Wiki
Starts an intent to open the file on Android.
Parameter | Description |
---|---|
filepath | Path of the file to open |
filetype | Type of the file, as a string, to be passed to Intent.setDataAndType |
orientation | (Optional) Orientation such as GUI_PORTRAIT or GUI_LANDSCAPE |
To use this or other modules that require intents and URIs, you must add the following files to your app directory:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="@[email protected]"
android:exported="false"
android:grantUriPermissions="true">
<!-- resource file to create -->
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths">
</meta-data>
</provider>
<?xml version="1.0" encoding="utf-8"?>
<paths>
<root-path name="root" path="." />
</paths>
(open-file (string-append (system-directory) (system-pathseparator) "test.mp4") "video/*")
(open-file (string-append (system-directory) (system-pathseparator) "test.pdf") "application/pdf")