I want to know what does file:/// mean while loading a html file from the assets folder in android
Is it an absolute path name which points to the root directory?
I saw this in the tutorial for phonegap by the way.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
file:///is a URI (Uniform Resource Identifier) that simply distinguishes from the standard URI that we all know of too well –http://.It does imply an absolute path name pointing to the root directory in any environment, but in the context of Android, it’s a convention to tell the Android run-time to say “Here, the directory
wwwhas a file calledindex.htmllocated in theassetsfolder in the root of the project“.That is how assets are loaded at runtime, for example, a
WebViewwidget would know exactly where to load the embedded resource file by specifying thefile:///URI.Consider the code example:
A very easy mistake to make here is this, some would infer it to as
file:///android_assets, notice the plural of assets in the URI and wonder why the embedded resource is not working!