Software Archive
Read-only legacy content

Could not access the local file system in windows phone

Sam_Deepak
Beginner
1,265 Views

 

Hi,

As per the documentation here at https://software.intel.com/en-us/xdk/docs/cordova-for-win-phone-build-options, I tried adding the capability for accessing the local file system (removableStorage) in intelxdk.config.additions.xml by creating a new preference.

But it did not work. Then I extracted the .appx file and saw that the AppManifest.xml does not have the capability I requested. The build system ignored it. Then I tried adding it manually in that manifest file and once again packed it in my machine using windows kits makeappx.exe .Still it did not work. 

Basically window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,function(fileSystem) {}, function(error){}) gives me only "ms-appx://local" path which is actually the private data directory for an app in windows phone. I want to access the root directory of the file system because I am letting the user to store app specific files anywhere in the phone. (It works in Android without specifying anything)

Could  you please help me figure out why the filesystem access capability is ignored in the build and also even when I add it manually why it did not work. Basically the above LocalFileSystem.PERSISTENT should not point to private data directory, rather it should be the root directory of the local file system.

 

 

 

0 Kudos
7 Replies
Elroy_A_Intel
Employee
1,265 Views

Which Windows device and version are you targeting for your application?

0 Kudos
Sam_Deepak
Beginner
1,265 Views

Hi Elroy,

I am targeting windows phone devices that have windows phone 8/8.1 versions. In future, I will also do for windows 10 phones.

 

0 Kudos
PaulF_IntelCorp
Employee
1,265 Views

See this post which contains some links regarding the differences between the various Windows webviews > https://software.intel.com/en-us/forums/intel-xdk/topic/607055.

In general, none of the mobile devices (Android, iOS, Windows Phone, Windows Tablet, etc.) allows you full access to the system filesystem, like what you are used to getting with a desktop computer. They all restrict filesystem access to the app's private space and, in some cases, a general-purpose file storage location (such as the /mnt/sdcard location on Android). I'm not clear on whether or not Windows provides something equivalent to the Android /mnt/sdcard space, but here are some links that might help understand:

That last one, in particular, appears to be a mechanism whereby you can allow the user of the device to locate a file on the system that is then given to your app. In other words, it restricts the app from searching for a specific file, allowing the user to decide which files your app is allowed to see.

Also, note from the links inside the other post that I gave you above, a Windows Phone 8.x app always runs in "local" mode, which has a lot of restrictions when running as a JavaScript app. Our build system does not currently have the ability to modify that run mode (I believe it is only possible to control on apps built for Windows 10) and the Cordova for Windows framework we currently support is not the latest version. Microsoft has been doing a lot of work with the Cordova project and some of what you're looking for may only be available in our upcoming XDK release, which will include a major update to the underlying Cordova platform frameworks, including the Windows framework.

0 Kudos
Sam_Deepak
Beginner
1,265 Views

Hi Paul,

My issue is, If I follow the instructions at https://software.intel.com/en-us/xdk/docs/cordova-for-win-phone-build-options to get permissions for removable storage, it is being ignored. And also I tried with ID_CAP_REMOVABLE_STORAGE  as said in here at https://msdn.microsoft.com/en-us/library/windows/apps/ff402541%28v=vs.105%29.aspx, the config file says the identifier is not found in http://schemas.microsoft.com/appx/2010/manifest.

Do you mean, I should wait for next release Intel XDK to see if I can have access to storage as I could in Android. Please advice.

 

0 Kudos
PaulF_IntelCorp
Employee
1,265 Views

I was told by one of the build engineers that the updated Windows framework that will come with our next build system provides better support for modifying the manifest file. So I think what you are running into, right now, is a deficiency in that version of Cordova for Windows. You can always install Visual Studio Express and Cordova CLI 6.0 on your workstation and try building directly, if you are unable to wait for our update.

0 Kudos
Sam_Deepak
Beginner
1,265 Views

Hi Paul,

By when, I can have the updated build system.

0 Kudos
PaulF_IntelCorp
Employee
1,265 Views

We're not allowed to publish expected release dates, against company policy. Hoping to see it in the next major release. Release cadences are approximately every 6-8 weeks.

0 Kudos
Reply