Extension. Unzip .zip file with subdirectories. Web local. Base64 to CloudDB. Source code

Yes, but if it's 10 or 100 MB or even GB...

I am sorry to ask, what is not working? :sweat_smile:

In this example we have a 25 MB fotos.zip file, it contains 7 photos of about 4 MB each (approx).
The Unzip is done in less than 3 seconds.

EDIT: CopyFile about 2 seconds. UnzipFolder: less than a second.

It is decompressed in
App/fotos/fotos/subdir/
The RemoveDirectory block doesn't work, maybe it's because it has many levels of subdirectories.

I can't upload the file to this Community because it is too big.

p175B_extension_unzip_stressB.aia (26 MB)

http://kio4.com/appinventor/275B_extensiones_descomprimir.htm#stress

EDIT:
I've added the DeleteDirectory block that deletes directories recursively.

extension_unzip10

This works, regardless if the subfolders are empty or not:

1 Like

Oh, yes because of the way it resolves relative paths.
If a path starts with file:// then remaing part is used as absolute path. So file:///sdcard/... works.
But if a path starts with / and doesn't contain /storage/emulated/0 then it is prefixed to the path.

1 Like

4.- Game in JavaScript: Pseudo 3D Racer.

Look at this game:
https://codeincomplete.com/games/racer/

Here we have its source code in JavaScript:
https://github.com/jakesgordon/javascript-racer/

Let's adapt it to App Inventor.
We modified the file v4.final.html and the common.css, you can download the coche.zip and observe the modifications.

We compress in .zip the files and folders in the coche.zip file
[I have not compressed the music directory because it contains unlicensed sound files]

See how App Inventor's Buttons act in the JavaScript code.

Game.run({
      canvas: canvas, render: render, update: update, stats: stats, step: step,
      images: ["background", "sprites"],
      keys: [
        { keys: [KEY.LEFT,  KEY.A], mode: 'down', action: function() { keyLeft   = true;  } },
        { keys: [KEY.RIGHT, KEY.D], mode: 'down', action: function() { keyRight  = true;  } },
        { keys: [KEY.UP,    KEY.W], mode: 'down', action: function() { keyFaster = true;  } },
        { keys: [KEY.DOWN,  KEY.S], mode: 'down', action: function() { keySlower = true;  } },
        { keys: [KEY.LEFT,  KEY.A], mode: 'up',   action: function() { keyLeft   = false; } },
        { keys: [KEY.RIGHT, KEY.D], mode: 'up',   action: function() { keyRight  = false; } },
        { keys: [KEY.UP,    KEY.W], mode: 'up',   action: function() { keyFaster = false; } },
        { keys: [KEY.DOWN,  KEY.S], mode: 'up',   action: function() { keySlower = false; } }
      ],

p_carrera_coches.aia (534.1 KB)

Proposal: Modify the block code so that instead of making movements with Buttons, they are made when moving the device using the AccelerometerSensor