EFile : Only asks for permissions when required

1.Introduction

EFile is a modified version of original File component.The only difference between File component and the extension is that the extension does not asks for write permission if you want to write to Application Specific Directory and read permission if you want to read from Application Specific Directory or Assets.

Latest Version: 2
Released: June 11, 2020

Last Updated: July 19, 2020

2.Blocks

image

3.Documentation

  • After File Saved
    Event indicating that the contents of the file have been written.
    component_event
    fileName ~ text
  • Got Text
    Event indicating that the contents from the file have been read.
    component_event (1)
    text ~ text
  • Append To File
    Appends text to the end of a file storage, creating the file if it does not exist.See the help text under SaveFile for information about where files are written.
    component_method
    text ~ text
    fileName ~ text
  • Read From
    Reads text from a file in storage.Prefix the filename with / to read from a specific file on the SD card.for instance /myFile.txt will read the file /sdcard/myFile.txt. To read assets packaged with an application (also works for the Companion) start the filename with // (two slashes). If a filename does not start with a slash, it will be read from the applications private storage (for packaged apps) and from /sdcard/AppInventor/data for the AI Companion and /sdcard/Makeroid/data for Kodular Companion.
    component_method (1)
    fileName ~ text
  • Save File
    Saves text to a file. If the filename begins with a slash (/) the file is written to the sdcard. For example writing to /myFile.txt will write the file to /sdcard/myFile.txt. If the filename does not start with a slash, it will be written in the programs private data directory where it will not be accessible to other programs on the phone. There is a special exception for the AI/Kodular Companion where these files are written to /sdcard/AppInventor/data (and /sdcard/Makeroid/data for Kodular) to facilitate debugging. Note that this block will overwrite a file if it already exists.If you want to add content to a file use the append block.
    component_method (2)

4.Downloads

Aix file
Download Link: com.sunny.EFile.aix (19.3 KB)

Java file
Download Link: EFile.java (11.4 KB)

5.Updates

Bug Fixes

  • Fixed bug in read and write file methods
    Now you can write to and read from ASD even using absolute path without any permission.
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments