Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android web服务器上以html格式获取高文件夹uri_Android_Html_Web_Uri_Href - Fatal编程技术网

如何在android web服务器上以html格式获取高文件夹uri

如何在android web服务器上以html格式获取高文件夹uri,android,html,web,uri,href,Android,Html,Web,Uri,Href,我正在开发一个应用程序,将文件(index.html、style.css…)安装到手机的SD卡上,用于web服务器 web服务器需要获取mp3文件才能播放 我的问题是我找不到我的mp3文件在哪里 例如 如果我把mp3文件放在index.html的同一个文件夹中,效果会很好 <a href="somthing.mp3" data-format="mp3 ogg">mp3 file</a> 然而,如果我把文件夹放在比index.html更高的文件夹中,我就

我正在开发一个应用程序,将文件(index.html、style.css…)安装到手机的SD卡上,用于web服务器

web服务器需要获取mp3文件才能播放

我的问题是我找不到我的mp3文件在哪里

例如

如果我把mp3文件放在index.html的同一个文件夹中,效果会很好

<a href="somthing.mp3"  
     data-format="mp3 ogg">mp3 file</a>

然而,如果我把文件夹放在比index.html更高的文件夹中,我就无法得到mp3的路径。。 我试过了



"http://xxx.xxx.xxx.xxx/index.html“是我的android web服务器


如何获取我的文件???

您是否有访问SD卡的正确权限?我有权限:权限。您是否使用4.1+?此外,您应该使用Environment.getExternalStoreDirectory()作为SD卡的根目录,因为它随设备而异。我的应用程序支持targetSdkVersion=“15”(ICS),即使我添加了权限,它也无法工作。
<a href="/sdcard/MUSIC/somthing.mp3"
  data-format="mp3 ogg">mp3 file</a>
<a href="http://xxx.xxx.xxx.xxx:8080/sdcard/MUSIC/somthing.mp3"
  data-format="mp3 ogg">mp3 file</a>