Unity Android Files Opener allows your android application to open files on local drive with (including API Level 24 or higher). If you encounter a problem on Android Application.OpenUrl does not work, then this will solve your problem!
Unity Editor 2017 or newer
Add Assets files to your Assets in Unity project.
The following example demonstrates how to open a file:
public void Example()
{
string dataType = "application/pdf";
string documentUrl = "/storage/emulated/0/Test Folder/template.pdf";
AndroidOpenUrl.OpenUrl(documentUrl, dataType); // you can specify any MIME type when opening a file by explicitly specifying the dataType parameter
}
The demo project creates the "Test Documents" folder in /storage/emulated/0 and you need to allow external write permission. Open Player Settings
in your project and change Write Permission
to External(SDCard)
.
PackageNameChanger.cs
cannot find the Plugins folder in the root of the Assets folder.
This error message can occur as a result of moving the Plugins folder to some other place that is different from the root of the Assets folder.
To solve the problem, just re-import the asset.PackageNameChanger.cs
cannot find the release.aar archive in the Plugins folder. This error may occur if you deleted, moved or renamed the release.aar file.
To solve the problem, just re-import the asset.PackageNameChanger.cs
should change it in the Plugins/release.aar files, but this did not happen because the file named release.aar no longer exists in the Plugins/release.arr folder.
To solve this problem, re-import the asset.PackageNameChanger.cs
during the process of renaming the package name creates a Temp folder in the Plugins folder. After the renaming process is complete, PackageNameChanger.cs
will delete this folder itself. This error may occur if you were able to remove it manually.
To solve this problem, restart the project.Write Permission
to Extarnal(SDCard)
in Player Settings
of your project.AndroidManifest.xml
, then consider that the Editor Script PackageNameChanger.cs
monitors the changes in the Package Name of your project and makes these changes in Plugins/realese.aar/AndroidManifest.xml and Plugins/realese.aar/res/xml/filepaths.xml filesPackageNameChanger.cs
located in the Editor folder is important.
Delete it only if you are not going to change the package name in the project anymore !!!This project is licensed under the terms of the MIT License.