Android vs ios filesystem


We are trying to display a list of users and their photo using the cordova library. For the iPhone the photo url is accessible using[0].value however the android can’t access it. The file must be downloaded first and saved to local storage. OK so having installed the cordova filesystem and file-transfer modules the following code is working on my phone.

The question is: How can I standardise this filestore location so that we can be sure it will work on all Devices? Or do all Androids use /storage/sdcard0/Android/AppName?

Is there any method for get this app file location?

savePhoto: function(userid,url){
var localstore = '/storage/sdcard0/Android/data/com.holladev/files/';
     $cordovaFile.downloadFile(url, localstore+userid+'.jpg', true).then(function(result){
                return friends[userid].photo = 'localstore'+userid+'.jpg';  
            }, function(error){

Thanks clever people for bringing us this awesome framework. We are very excited about our new playground :wink:


You can use requestFileSystem() to obtain a managed file root, and then use getFile(“”) to get a file entry, finally pass the entry.toURL() to FileTransfer.

For you case, LocalFileSytem.TEMPRORY could be preferred for the requestFileSystem for temporary data. See Cordova File docs below 3.5 for more details.