- Home /
Question by
BazLevelUp · Oct 19, 2012 at 12:16 PM ·
androiderrorwww
How to WWW a file on Android?
I'm trying to load a file on Android using WWW and I'm getting an error.
void Start()
{
WWW downloadedAsset = new WWW("file://sdcard/Music/mywavfile.wav") ;
}
Void Update()
{
if (downloadedAsset.isDone)
if (downloadedAsset.error != null )
Debug.Log("WWW - Download - ERROR -> "+downloadedAsset.error) ;
else
[Do stuff]
}
keep getting the error "java.io.ioexception unable to connect to server - Host is unresolved:sdcard" *
I have found that but that's not helping :(
Do you have any idea please?
Comment
Best Answer
Answer by BazLevelUp · Oct 25, 2012 at 12:48 PM
The problem was that "sdcard" is NOT a folder, but some sort of link to the sdcard. It was so not a real path. The real path was "mnt/sdcard"
Answer by ZJP · Dec 02, 2012 at 04:12 PM
Works well with
WWW downloadedAsset = new WWW("file:///sdcard/Music/mywavfile.wav") ; Yes three "/" ;)
Your answer
Follow this Question
Related Questions
A phone network question!About GSM 、wifi and WWW! 0 Answers
java.io.FileNotFoundException www error android 1 Answer
About www.error! 1 Answer