#1 2018-01-02 11:04:17

frecciag50
Member
Registered: 2016-10-22
Posts: 8

Access Read/Write Text File.

Ola David   

   I find some difficulties to read and write text file in the data directory. Obviously I followed your 'Files' demo by adding the appropriate plugin cordova-plugin-file. Probably it can help you that at installation time of the apk it does not appear permission: read from SD contents (unique permission LAN access).

  Balscioi Spassiba

Offline

#2 2018-01-02 12:03:19

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,710
Website

Re: Access Read/Write Text File.

Hello Napoleone,

Sorry, but, I can't reproduce the problem here in Android 6.0. The Files app sample already includes the Apache Cordova File plugin, so, you no need to add it by yourself. On the other hand, the App Builder "Files*" action store the created files in an "app data directory", which, do not requires permissions, according to the documentation. I test the Files app sample right now (without permissions) and they works as expected.

P.S. I note that the "to be write" input is empty by default... maybe you trying to write that empty input and therefore can't get nothing readed from the "Other.txt" file? I will add some default content for that input for the next App Builder release.

Online

#3 2018-01-02 16:01:48

frecciag50
Member
Registered: 2016-10-22
Posts: 8

Re: Access Read/Write Text File.

Vale David I Solved the problem forcing versione of cordova plugin:

  <gap:plugin name="cordova-plugin-file" source="npm"  spec="3.0.0" />

  with spec=3.0.0. editing directly/manually the config.xml

  How i can force this directive in the App project.

Offline

#4 2018-01-02 16:06:37

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,710
Website

Re: Access Read/Write Text File.

Hello Napoleone,

The point is what do you need to do that... that is, why you can't use the latest version of the File Cordova plugin.

You no need to deal with XML at all (even when you can do it in the Extra XML option of the app).

My recomendation is that you try with the Files sample "as is", and view if they works for you like for me.

On the other hand, answering your question, if you want to add the Cordova File plugin, for example, specifiying a version, then you must "uncheck" the File plugin from App Cordova -> General -> Plugins, and, add the below code to the App Cordova -> Batch -> After:

CALL cordova plugin add cordova-plugin-file@^3.0.0

Online

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.