Share this post on:

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: 4
Released:  June 11, 2020
Last Updated:  June 23, 2021

2.Blocks

image

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
  • Get Cache Dir Path
    Returns the absolute path to the application specific cache directory on the filesystem
    image
    Returns : text
  • Get Private Dir Path
    Returns app’s private storage directory path
    image
    Returns : text

See here why is it important: Problem with July 30 2020 Version: nb184 no longer able to write and read files – Bugs and Other Issues – MIT App Inventor Community 27

  • Get External Storage Path
    Returns external storage path
    image
    Returns : text
  • Get Application Specific Dir Path
    Returns asd path
    image
  • 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 and Java file can be downloaded from here:

https://github.com/vknow360/EFile

5.Updates/ChangeLog

ChangeLog Version2

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.

ChangeLog Version3

New Blocks
image

Changes

  • Some internal changes

ChangeLog Version4

New Blocks
image

Changes

  • LegacyMode will now specifiy where a filename without any / should be written to.Enabling it means files will be written in Application Specific Directory and disabling it means files will be written in Private Storage Directory.
  • It is no longer fully compatible with Kodular Companion.

Hope it helps!

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments