an extension for AI2 that extends the features of the native webviewer
The extension provides a file filtering option, using file mimetypes, in order to limit the available files offered for upload. Files that are not available are usually still visible, but greyed out/ or non-selectable. It should be possible to browse all the shared directories and select files.
Blocks to provide Files in ASD for upload
First up you need to set the default filescope to Legacy in Screen1 properties.
You will need the File component.
Also bear in mind that the extension needs to be in place and loaded to the webviewer, this will set the required read and write external storage permissions for the app.
This will not work unless you make these settings.
You need to create a directory in the Shared Folders for the ASD files. In this example, the directory is created in /Documents
Then you can copy all the files in your ASD to the folder you have created
When you have finished uploading files from your Shared ASD folder, you can, if you wish, delete all the files there.
Files are saved to the shared Download directory on the device.
It should be possible to download files from any download link with a filename at the end, but will also work where the filename is obfuscated by the website, e.g. Google Drive, or the AI2 community.
It is possible to browse a shared google drive folder, and download a file from there (you may need to be signed into a google account for this to work)
HTML file which contains some example links
Here, we remove the `: wv` from the existing userAgent, helping to fool Google and other sites to believing that the webviewer is not an embedded webview.
It seems that simply removing ; wv from the default useragentstring is now not enough, and we also need to remove Version/4.0 and Mobile . Also, not all android devices present the same webview useragentString, e.g. Samsung, Asus, Redmi, Motorola..., therefore it may be necessary to modify the useragent presented in those webviews, hence the provision of the get and set useragent blocks. A useful link for native browser user agents: Device Atlas.
Here is a simple web app that helps to demonstrate the benefit of the modified userAgent. You can test this in a standard webviewer and one with the extension to see the difference. You must be logged into your google account inside the webviewer. The webviewer will remember your login for subsequent use. Here also are two useful urls for loggin in and signing out of Google.
Copy the url below, which is a simple webapp that requires a google account user to authenticate the web app to access the google account. The webapp itself, using the url below, will do nothing other than return a text message to the webviewer if authorisation has worked. If you follow the authentication through, you can revoke access in your Google Account/Security/Third Party Apps.
This modification may not have the desired effect in all settings....
Allow File Access
Provides the webviewer with access to the file system. Several of the other features will require this.
Set READ & WRITE EXTERNAL STORAGE permissions for app
The following permissions are set in the manifest file of the extension:
This will enable some of the features to access files, but also, enable the app, with the correct filescope settings, to copy files from the ASD to a shared directory, making them available for uploading. Also added are the new MEDIA permissions required by the Sep 2023 update to Android.
This setting turns zoom features on or off
This extension was created following extensive research carried out on StackOverflow, Android Developers, Youtube, and many other internet sites providing java/android solutions to the issues raised in putting it together. Hundreds of topics and web pages eventually provided all the answers.
A special mention to Sunny Gupta(vknow360) and Luke Gackle, whose open sourced extensions provided some of the groundwork.