Extension: Explorer files and directories.

889 views
Skip to first unread message

Juan Antonio

unread,
Aug 26, 2017, 7:56:26 AM8/26/17
to mitappinv...@googlegroups.com
Hi friends,

this extension is an explorer of files and directories.

You can obtain name or long format information with ExplorerX.



When is a directory, last chart is a "slash".

---------------------------------------------------------------------------------------------

This is other example about this extension:

- First element of ListView is Up Directory (..)
- Second element of ListView is Actual Directory (.)





- Regards.


Juan Antonio Villalpando.


kio4.com







p280i_Extension_Explorador.aia
com.KIO4_Explorer.aix

Abraham Getzler

unread,
Aug 27, 2017, 2:00:51 PM8/27/17
to MIT App Inventor Forum

albert choong

unread,
Aug 30, 2017, 10:16:41 AM8/30/17
to MIT App Inventor Forum
It's good!
But I got runtime error when I click start button and any directory the first time.

If I click /mnt/ first instead then click any other directory, there's no runtime error.

Capture+_2017-08-30-12-55-15.png

Juan Antonio

unread,
Aug 30, 2017, 12:26:47 PM8/30/17
to MIT App Inventor Forum
Hi albert,

this works for me, I write, example; /mnt/sdcard/Android/ and works.

Maybe error is in Blocks-code App inventor.

-------------------------------------------------------------------------------------------


But I get an error only with mount point root, (only slash /)



If I write / in TextBox1 and then click button, I get error runtime, but...
if I insert a slash chart, it works fine.



Juan Antonio

unread,
Aug 30, 2017, 2:31:58 PM8/30/17
to MIT App Inventor Forum
This is other version.

I add RemoveFile, RemoveDir, MakeDir, Move, Copy and FileInfo.



- My Blocks-code in p280i_Explorer_Ops.aia is a simple example, it isn't optimized.





p280i_Explorer_Ops.aia
com.KIO4_Explorer_Op.aix

Taifun

unread,
Aug 30, 2017, 5:36:36 PM8/30/17
to MIT App Inventor Forum
for large files, the Copy and Move method might block the user interface...
see also the file extension, which additionally offers asynchronous methods for Copy and Move...

Taifun 

Abraham Getzler

unread,
Aug 30, 2017, 5:42:29 PM8/30/17
to MIT App Inventor Forum

albert choong

unread,
Aug 30, 2017, 11:36:28 PM8/30/17
to MIT App Inventor Forum
Hi Juan

I tried to add some blocks to check if there is no slash in front of selection and  add /mnt/ , it seems to work. Can go to the directories without having to click /mnt/ first time and no runtime error. 

See image.


Also just some feedback...when I access external sd  card, some directories appear as a file .
Eg: a folder called Presents is shown as /mnt/m_external_sd/Presents with no slash at the end.

and some files are shown as a directory.
Eg: a file called thingsToDo.txt is shown as /mnt/m_external_sd/thingsToDo.txt/ with a slash at the end.

blocks.png

Juan Antonio

unread,
Aug 31, 2017, 4:48:43 AM8/31/17
to MIT App Inventor Forum
This extension use LINUX commands for copy and move (not code java).

Copy use cp command, is very speed, in my mobile 40 photos with a total of 120 MB is a delay less of 2 seconds. A file of 20 MB is instantaneous.

Move use mv command, in LINUX files not move, only change name (same inode), so instanteneous.

---------------------------------------------------------------------------------------------------
Examples:

Make dir
Source: /mnt/sdcard/delete_me

Copy all files from a directory to other:

Source: /mnt/sdcard/DCIM/*.*
Dest: /mnt/sdcard/delete_me/                    (look final slash)



Remove a directory:

Source: /mnt/sdcard/delete_me/               (look final slash)







Juan Antonio

unread,
Aug 31, 2017, 5:19:54 AM8/31/17
to MIT App Inventor Forum
Hi Albert, maybe Presente is a "hard link".

You can download app in this post:


and write

ls -al /mnt/sdcard/your_directory/

If line start with d is a directory, start - is a file, start l is an hard link


Eg: 

ls -al /mnt/sdcard/your_directory/

drwxr-xr-x root root date time name_directory

-rw-r--r-- user user size date time name_file

lrwxrwxrwx root root date time sdcard -> /storage/emulated/legacy

albert choong

unread,
Aug 31, 2017, 6:01:18 AM8/31/17
to MIT App Inventor Forum
Hi Juan

OK I've tried the extension terminal and it shows that my directories are listed correctly as directories (with a 'd' in front) and files listed correctly as files (with a '-' in front).

No hard links for any files.

Juan Antonio

unread,
Aug 31, 2017, 10:23:00 AM8/31/17
to mitappinv...@googlegroups.com
Hi Albert, thank you for info.

This is a new version with fixed error in slash.


EDIT: delete this version for compilation error.

albert choong

unread,
Sep 1, 2017, 1:34:26 AM9/1/17
to MIT App Inventor Forum
Hi Juan
It's working okay now. Thanks.

But when I try to build into apk I get these errors:

App Inventor is unable to compile this project. 
 The compiler error output was 
________Preparing application icon
________Creating animation xml
________Generating manifest file
________Attaching native libraries
________Attaching component assets
________Compiling source files
(compiling appinventor/ai_nrutas01/p280i_Extension_Explorador2/Screen1.yail to appinventor.ai_nrutas01.p280i_Extension_Explorador2.Screen1)
(compiling /tmp/runtime2482898142552950365.scm to com.google.youngandroid.runtime)
Kawa compile time: 19.283 seconds
________Invoking DX
YAIL compiler - DX execution failed.
  • .

Taifun

unread,
Sep 1, 2017, 10:32:50 AM9/1/17
to MIT App Inventor Forum
@Albert concerning the "DX execution failed" error,  is this the only extension you are using?
if not, which extensions do you use?
Taifun

albert choong

unread,
Sep 1, 2017, 11:08:25 AM9/1/17
to MIT App Inventor Forum
Hi Taifun
I've used Juan's latest file explorer .aia sample
and tried to build apk - and got the errors.
It's using only his own extension and no others.

Taifun

unread,
Sep 1, 2017, 11:47:39 AM9/1/17
to MIT App Inventor Forum
in this case, Juan might want to check his extension...
Taifun

Juan Antonio

unread,
Sep 1, 2017, 4:17:12 PM9/1/17
to MIT App Inventor Forum
+1 to Taifun.

Thank you Taifun!, many test-files.java in componets/runtime produced the error, ant compile but then Yail fail to build apk.

Thank you Albert, you are a great beta tester :)




p280i_Extension_Explorador.aia
com.KIO4_Explorer.aix

albert choong

unread,
Sep 2, 2017, 12:35:52 AM9/2/17
to MIT App Inventor Forum
Hi Juan,
Yay!
It's all working very well now.
Thanks! :)

Juan Antonio

unread,
Sep 3, 2017, 4:47:17 PM9/3/17
to MIT App Inventor Forum
- New version.

- Now App Inventor code for Explorer is very simple, only 2 blocks.

- When is a directory, last chart is a "slash". (Example: /mnt/sdcard/mydirectory/)

- First element of ListView is Up Directory (..)
- Second element of ListView is Actual Directory (.)




p280i_Extension_Explorador_v2.aia
com.KIO4_Explorer.aix
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages