I'm trying to load a custom local html file into a WebViewer using WebView.LoadUrl()
, but I can't seem to find the correct path to it.
Path to the class calling the WebView.LoadUrl()
function:
appinventor-extensions\appinventor\components\src\tmice\src\br\ufsc\gqs\teachablemachineimageclassifier\TeachableMachineImageClassifier.java
Path to the html file:
appinventor-extensions\appinventor\components\src\tmice\src\br\ufsc\gqs\teachablemachineimageclassifier\assets\teachable_machine_image_classifier.html
(In other words, the html file is at /assets
, relatively to the class calling it.)
To pass this path as a parameter to WebView.LoadUrl()
, I've tried:
- Using an absolute path according to Anke's post (
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/teachable_machine_image_classifier.html
) - Using
getAssetPathForExtension()
passing"teachable_machine_image_classifier.html"
as the asset parameter.
What is the correct way to access this html file, both in a AI2 Companion-emulated and compiled Apps?
Is getAssetPathForExtension()
the correct way to get the html's path? If so, how do I reference it as an asset?