Problem with TaifunFile extension

203 views
Skip to first unread message

Fabian Pedrosa

unread,
Apr 15, 2019, 9:30:31 AM4/15/19
to MIT App Inventor Forum
Hi everybody!
I´m trying to use TaifunFile extension and I´m experiencing some weird (at least that seems to me) problems.
Whem I add the extension and try to list a directory, it works once in a while, but most of the time the app crashes
and android offers to open it again but to no avail.

bloques.png

The attached image shows highlighted with yellow border line the block I´m pretty sure causes the crash. I really don´t know what to do. My need is obtain a list of files names from a specific directory, just that.
Thanks in advance.

Fabián

Taifun

unread,
Apr 15, 2019, 1:39:21 PM4/15/19
to MIT App Inventor Forum
the blocks look fine
how many images are there in that directory?

to find out more about the Runtime Error, you can use Logcat

I normally use Eclipse and Logcat there, but if you have installed the App Inventor Software (see also http://appinventor.mit.edu/explore/ai2/setup-emulator.html), you already have everything you need to use logcat...

How to use Logcat
  1. connect your device using USB with your computer
  2. in File Manager go to the App Inventor directory, which is  C:\Program Files\App Inventor or similar
  3. press Shift and right mouse click the subdirectory commands-for-Appinventor to get the context menu
  4. select "open command window here" and you will get a command window of that subdirectory
  5. enter adb logcat *:E and the logcat will start running and log all errors
  6. start your app to elicit the error
  7. copy the log (see below)
To copy your log, right click, click "select all" and enter to copy the complete log into the clipboard, then open Notepad and paste it using ctrl-v.

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 


Fabian Pedrosa

unread,
Apr 16, 2019, 3:01:36 PM4/16/19
to MIT App Inventor Forum
Hi.
There are only 4 jpgs in the subdirectory.
I don´t have Emulator installed. So, using logcat is somewhat far away from me right now.
Sometimes (only sometimes), the error message is something related to "Null asignment to array" (or similar). If I can I´ll capture a screen and attach the screenshot. But most of the time the app only crashes at start (the blocks I´ve shown are in Screen.Initialize).
Thanx!

Fabián

TimAI2

unread,
Apr 16, 2019, 3:09:46 PM4/16/19
to MIT App Inventor Forum
Probably need to see the whole screen initialise,
and you may want to remove elements one at a time until you find the one causing the problem...

Taifun

unread,
Apr 16, 2019, 5:40:14 PM4/16/19
to MIT App Inventor Forum
from your screenshot we also can see, you are using 7 clocks... why do you need 7 clocks?
there might be happening too much at the same time... you are also connecting to a SSID  in parallel...
and what happens in the Clock7.Timer event, Clock7 was started before using the FileListAsync method?

temporarily you might want to do different things step by step to see if it works then...
for example first connect to the wifi and if the connection is done, then continue with something else etc etc.

Taifun



Fabian Pedrosa

unread,
Apr 17, 2019, 8:13:35 AM4/17/19
to MIT App Inventor Forum
Long story short. 7 clocks were used in previous iterations of this app. The only one that is necessary here is Clock 7 IIRC.
WiFi works as expected. I´ll post the whole init block later today.
I´ve done things step by step and the file list is the apparent cause of troubles.
More info coming soon.
Thanx.

F.

Taifun

unread,
Apr 17, 2019, 3:31:16 PM4/17/19
to mitappinv...@googlegroups.com
does the test project "Test FileList" downloadable from here work for you?

filelist2.JPG



Taifun

Fabian Pedrosa

unread,
Apr 18, 2019, 2:30:59 PM4/18/19
to MIT App Inventor Forum
I'll try that and let you know.
Thanx!

Fabian Pedrosa

unread,
Apr 22, 2019, 8:58:41 AM4/22/19
to MIT App Inventor Forum

Screenshot_2019-04-22-09-25-55.png

Screenshot_2019-04-22-09-25-46.png

Hi.
I´ve just compiled and tried FileList app. When pressing 1st button runtime error happens (see attached picture).
When I press the 2nd button (Async), the app crashes (see other image).
Any ideas?
Thanx!

Taifun

unread,
Apr 22, 2019, 4:51:28 PM4/22/19
to mitappinv...@googlegroups.com
this happens because of the missing permission READ_EXTERNAL_STORAGE
I added the permission blocks (see screenshot) for you into the example project, just download it and try again

Taifun

Unbenannt.JPG


Fabian Pedrosa

unread,
Apr 23, 2019, 7:52:20 AM4/23/19
to MIT App Inventor Forum
Thanx! I´ll let you know during this day.

Taifun

unread,
May 4, 2019, 3:51:15 PM5/4/19
to MIT App Inventor Forum
Reply all
Reply to author
Forward
0 new messages